This is not a valid solution. It does not meet the requirement of elements in each subset being sorted. Try the input [1 3 2] and it does not give sorted subsets.
Get the area codes from a list of phone numbers
537 Solvers
320 Solvers
137 Solvers
221 Solvers
126 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!