NeetCode #211LC-948MediumTwo Pointers
← Back to All Problems

#211 · #948 · Bag of Tokens(令牌放置)

📌 Problem Statement & Constraints

You start with power tokens and score = 0. You may play a token face up if you have at least tokens[i] power (gaining 1 score and losing that much power), or face down if your score is at least 1 (gaining tokens[i] power and losing 1 score). Each token may be used at most once. Return the maximum possible score. Constraints: 0 <= tokens.length <= 1000, 0 <= power, tokens[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!