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
defsat(nx: List[int], x=[1, 2, 4, 3]):
"""Find the next permutation of a given list by lexicographical ordering."""importitertoolsassertlen(x) ==len(nx) andset(x) ==set(nx)
returnx<nxandall([list(perm) <=xorlist(perm) >=nxforperminlist(itertools.permutations(x))])
Reveal solution
Reveal solution
Solvers, post your solutions in the comments using the following formatting:
The text was updated successfully, but these errors were encountered: