завтрашний дейлик https://leetcode.com/problems/predict-the-winner (пример как делать cache без tuple)
class Solution:
def predictTheWinner(self, n: List[int]) -> bool:
return(f:=cache(lambda*t:t and max(t[0]-f(*t[1:]),t[-1]-f(*t[:-1]))or 0))(*n)>=0