This is the answer i have given and interviewer said, "Optimise it
further in terms of memory and character need not be ASCII"

On Aug 22, 6:28 pm, Ashish Goel <[email protected]> wrote:
> use a array
> arr[char]=count char represent say a-z
> count is # of occurances
>
> while (*s!='\0')
> {
> arr[*s-'a']++;
> if (arr[*s-'a']==1) lastchar=*s;
>
> }
>
> lastchar is the last non repeating char
>
> Best Regards
> Ashish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
> On Sun, Aug 22, 2010 at 3:30 PM, Saikat Debnath <[email protected]>wrote:
>
>
>
> > How to find last unique character in a given string. Unique character
> > means non-repeated number. Give an optimized way.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<algogeeks%2bunsubscr...@googlegroups 
> > .com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/algogeeks?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to