id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

norm.krumpe@muohio.edu > single
prev  |  next  |  chance

In a given string, all the characters are the same except for one of them. Return that one character that is different from the rest. The string will contain at least 3 characters.


single("aaaba") → "b"
single("wxx") → "w"
single("ggggG") → "G"

...Save, Compile, Run (ctrl-enter)

char single(String str) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 200

Copyright Nick Parlante 2017 - privacy