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
/*Declare a function 'nextLexGreater' that takes a string as input and returns a modified version of the string. The function should rearrange the characters in the string in such a way that it produces the next lexicographically greater permutation of the characters. If such a permutation is not possible, the function should return the original string.