• + 0 comments

    i had tried a dynamic programming approach with dp[n][n] and time complexity O(n^2) but this be able to pass only 7/21 test cases.As dp[100000][100000]could be a problem what could be an alternative to such a large 2D array