// Maximum Points from Cards — MEDIUM
// Category: sliding-window
There are several cards arranged in a row, and each card has an associated number of points. The points are given in the integer array `cardPoints`.
In one step, you can take one card from the beginning or from the end of the row. You have to take exactly `k` cards.
Return the **maximum** score you can obtain.
Example: cardPoints = [1,2,3,4,5,6,1], k = 3
Output: 12