You are given an integer array tokens and an integer power.
You begin with an initial score of tokens can be played at most once in any order, using one of the following moves:
Face up: If your current power is at least tokens[i], you can play token tokens[i] power and gaining
Face down: If your current score is at least tokens[i] power and losing
Return the maximum score you can achieve after playing any number of tokens.
Constraints:
tokens.length
tokens[i], power
You are given an integer array tokens and an integer power.
You begin with an initial score of tokens can be played at most once in any order, using one of the following moves:
Face up: If your current power is at least tokens[i], you can play token tokens[i] power and gaining
Face down: If your current score is at least tokens[i] power and losing
Return the maximum score you can achieve after playing any number of tokens.
Constraints:
tokens.length
tokens[i], power