Modifying as in Leetcode format