Leetcode 3031. Minimum Time to Revert Word to Initial State II | Hello Interview