Skip to content

Instantly share code, notes, and snippets.

@jboursiquot
Created February 6, 2019 01:28
Show Gist options
  • Select an option

  • Save jboursiquot/d23d2e48f7f476b60314aed970a4d44b to your computer and use it in GitHub Desktop.

Select an option

Save jboursiquot/d23d2e48f7f476b60314aed970a4d44b to your computer and use it in GitHub Desktop.

Non-repeating character in a string

Write a function that takes a string and returns the first character in it that does not repeat two or more times.

Example:

nonRepeating("abcba") // should return "c"
nonRepeating("ddgTwWgpp") // should return "w"

Problem Set

"abcab" // should return "c"
"abab" // should return ""
"aabbbc" // should return "c"
"aabbdbc" // should return "d"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment