6 ms·Is it DP? I think DP is O(N^3)? That will be a funny way(Matlab) to solve this...by rohananil 15y agoIs it DP? I think DP is O(N^3)? That will be a funny way(Matlab) to solve this...