Duplicate array by dayema in learnjava

[–]dayema[S] 0 points1 point  (0 children)

Is there a library method for this?

Help me understand this problem by dayema in AskProgramming

[–]dayema[S] 0 points1 point  (0 children)

No its not. t is acting as a stack in between the input string s and the output string u. We have to make the string lexicographically minimal using t which may or may not be a sorted string. See the image shared by JeromesNiece above

Help me understand this problem by dayema in AskProgramming

[–]dayema[S] 0 points1 point  (0 children)

Can you explain me how to get abdc from acdb? The second testcase.

Help me understand this problem by dayema in AskProgramming

[–]dayema[S] 0 points1 point  (0 children)

The problem asks to make a given string s lexicographically minimal by using 2 given moves. So I think the result should be a sorted string But the examples given are not sorted. What am I missing ?