Facebook Interview QuestionSDE-2s
- 1of 1 vote
GIven a string "str" and pair of "N" swapping indices, generate a lexicographically largest string. Swapping indices can be reused any number times.
String = "abdc"
cdba, cbad, dbac,dbca
you should print only "dbca" which is lexicographically largest.
Country: United States
Interview Type: In-Person