Your output: abba whie correct answer is abab
No correct answer it shall be lexicographically then it I’ll be aabb.
Why you have to cout>> for the lexicographically order in two while isn’t that a repetion for same sort.
The correct answer should be lexicographic but should also include the shorter string (ba)
so it should be (a"ba"b)
It should also contain ba
But why it cant be like abba, it is also containing the ba itself.
Because you dont know what dictionary order means
Because it’s not lexicographically first.