Search⌘ K
AI Features

Maximum Points You Can Obtain from Cards

Try to solve the Maximum Points You Can Obtain from Cards problem.

We'll cover the following...

Statement

You are given an integer array cardPoints, where each element represents the points on a card in a row. You must take exactly k cards. On each move, you may take one card from either the beginning or the end of cardPoints.

Return the maximum total points you can obtain after taking exactly k cards.

Constraints:

    ...