Menu
Coddy logo textTech

Single Character

Lesson 1 of 3 in Coddy's Interview Coding Challenges - Pack V course.

challenge icon

Challenge

Easy

Write a function singleChar which gets a string s, every character in s appears twice except for one, return from the function the character which appears only once!

 

Example:

Input - "aabdb"

Expected Output - "d"

Explanation - "a" and "b" appear twice and "d" appears only ones.

Try it yourself

#include <string.h>
#include <stdlib.h>

char* singleChar(char* s) {
    // Write code here
}

All lessons in Interview Coding Challenges - Pack V

1Challenges

Single CharacterLetter ConstructionCount Primes