Skip to content

Latest commit

 

History

History
23 lines (13 loc) · 649 Bytes

first_not_repeating_character.md

File metadata and controls

23 lines (13 loc) · 649 Bytes

Back

First Not repeating Character

Challenge description

Given a string s consisting of small English letters, find and return the first instance of a non-repeating character in it. If there is no such character, return '_'.

Example

  • For s = "abacabad", the output should be solution(s) = 'c'.

    There are 2 non-repeating characters in the string: 'c' and 'd'. Return c since it appears in the string first.

  • For s = "abacabaabacaba", the output should be solution(s) = '_'.

    There are no characters in this string that do not repeat.

Solution

Solved with Rust