Stone Game V

Solution Code

Time Complexity

O(n^3) for Approach 1

Space Complexity

O(n^2)