NeetCode #792LC-1423MediumGreedy
← Back to All Problems

#792 · #1423 · Maximum Points You Can Obtain from Cards(可获得的最大点数)

📌 Problem Statement & Constraints

There are several cards in a row with cardPoints[i] points. In each step you take one card from either the beginning or the end. You must take exactly k cards. Return the maximum score. Constraints: 1 <= k <= cardPoints.length <= 10^5, 1 <= cardPoints[i] <= 10^4.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!