Maximize minimum after K decrements | MathWorks Interview Question