codeforces educational round

could anyone suggest a simpler stategy for solving the

Just brute-force it, since N is very small. (N<= 50)

1 Like

You can use 2D DP and Sorting.

Here is link to my solution.

At any point, you can choose to find the difference between adjacent numbers or you can leave it.You must remember that you can leave atmost 2 numbers.

1 Like