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
{{ message }}
This repository was archived by the owner on Feb 19, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 19, 2026. It is now read-only.
New puzzle: next permutation in lexicographical order #7
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))])
Activity
akalai commentedon Jun 18, 2021
Nice one!
Reveal solution