Infosys Interview Question

Minimum Prefix Problem from leetcode.