C Bug: Character Count | Sololearn: Learn to code for FREE!


C Bug: Character Count

Count the number of characters only if the characters are ('A', 'T', 'C', 'G'), else 'Invalid input'. ========== Example_01 ========== Input: ATTCCGG Output: A 1 T 2 C 2 G 2 ========== Example_02 ========== Input: AKLTCG Output: Invalid input ========== I have the code above which runs for the count but does not tell whether it is an invalid case. Code: https://code.sololearn.com/ca25A24A3A9A ========== Probably, the else if statement in the function, count, went wrong. not sure... Any help, would be highly appreciated... Thanks

4/12/2021 4:48:50 AM

Arun Bhattacharya

4 Answers

New Answer


Thanks Coder Kitten, was really helpful...