Why the return of "cbacdcbc" is "acdb"? Should be "adbc"?
Cann't understand it.
acdb: c b (a) (c) (d) c (b) c
adbc: c b (a) c (d) c (b) (c)
acdb < adbc
So choose acdb
Both words can be reached, but the problem states
"You must make sure your result is the smallest in lexicographical order among all possible results."
And "acdb" is smaller than "adbc".
@madhur3 Because "abcd" can't be reached from "cbacdcbc" by just removing letters.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.