Find the first unique char in an array of char.
solution in O(n).
Take an array of 256 size, in the first iteration put count of each variable in the array.
In the 2nd iteration, check count of each char in the array, whatever char whose count is 1, is the first unique char in the string.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks