You have tokens with values and start with power and score .
You can play token face-up (lose power, gain score) if you have enough power. Or play face-down (gain power, lose score) if score . Maximize final score.
Think about when to spend power and when to cash in score for power. Tricky: playing face-down gives you power but costs score.
You only do this when you cannot afford any face-up plays. The two-pointer setup ensures you always have access to both the smallest (cheapest to play face-up) and largest (best power gain face-down) tokens.