comparision sort👑 

Run Settings
LanguagePython
Language Version
Run Command
s = [ 1 ,5 ,8 ,0 ] res = [] def dfs(idx ,cur) : if idx == len(s) : if cur : res.append(cur) return dfs(idx + 1 , cur + [s[idx]]) dfs(idx + 1 , cur ) dfs(0 , []) print(sorted(res , key = lambda x : (len(x) , x))) # x belongs to jagged - array
Editor Settings
Theme
Key bindings
Full width
Lines