• + 0 comments

    Your solution is O(NlogN) by the sort algorithm, with dynamic programming is faster because it is linear.