Apply Operations To An Array Leetcode Questions