AlgoMaster Logo

Maximum Width Ramp

nums=[6, 0, 8, 2, 1, 5]
0 / 20
algomaster.io
Step:Brute force: for each i, scan j from the right for the widest valid ramp.