Game Theory LeetCode Problems: All 25, With Python Solutions

Every problem in this library that LeetCode tags Game Theory 25 in total, 20 of them with a complete Python solution, a worked example and the time and space complexity of the approach.

  • 25 problems
  • 2 Easy
  • 13 Medium
  • 10 Hard

Game Theory problems by difficulty

Problems with a complete Python solution are listed first, then by ascending problem number.

Easy (2)

#ProblemDifficultyTopics
292Nim GameEasyBrainteaser, Math, Game Theory
1025Divisor GameEasyBrainteaser, Math, Dynamic Programming +1

Medium (13)

#ProblemDifficultyTopics
375Guess Number Higher or Lower IIMediumMath, Dynamic Programming, Game Theory
464Can I WinMediumBit Manipulation, Memoization, Math +3
486Predict the WinnerMediumRecursion, Array, Math +2
877Stone GameMediumArray, Math, Dynamic Programming +1
1140Stone Game IIMediumArray, Math, Dynamic Programming +2
1561Maximum Number of Coins You Can GetMediumGreedy, Array, Math +2
1686Stone Game VIMediumGreedy, Array, Math +3
1690Stone Game VIIMediumArray, Math, Dynamic Programming +1
1927Sum GameMediumGreedy, Math, String +1
2029Stone Game IXMediumGreedy, Array, Math +2
2038Remove Colored Pieces if Both Neighbors are the Same ColorMediumGreedy, Math, String +1
294Flip Game IIPremiumMediumMemoization, Math, Dynamic Programming +2
1908Game of NimPremiumMediumBit Manipulation, Brainteaser, Array +3

Hard (10)

#ProblemDifficultyTopics
810Chalkboard XOR GameHardBit Manipulation, Brainteaser, Array +2
913Cat and MouseHardGraph, Topological Sort, Memoization +3
1406Stone Game IIIHardArray, Math, Dynamic Programming +1
1510Stone Game IVHardMath, Dynamic Programming, Game Theory
1563Stone Game VHardArray, Math, Dynamic Programming +1
1728Cat and Mouse IIHardGraph, Topological Sort, Memoization +5
1872Stone Game VIIIHardArray, Math, Dynamic Programming +2
843Guess the WordHardArray, Math, String +2
2005Subtree Removal Game with Fibonacci TreePremiumHardTree, Math, Dynamic Programming +2
2868The Wording GamePremiumHardGreedy, Array, Math +3

When the Game Theory problem arrives live

Stealth Interview is a desktop app for macOS and Windows. It reads the coding problem off your screen, returns a working solution with a step-by-step explanation and its time and space complexity, and transcribes what the interviewer is saying — while staying invisible to screen sharing.