You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Logic: Maintain an array of length 26 to keep note of the index at which the letter in the given string is last observed
Next, build a stack such that the character pushed first is added if and only if it the last occurance and also the ascii value is less than the valuw previous,
Also maintain a visited array to handle multiple additions of same char to the stack.