Add Consecutive-Value Bonuses to Grid Paths
Company: OpenAI
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
Quick Answer: Extend the maximum-score grid path with bonuses for equal adjacent values and strictly increasing triples of visited cells. Dynamic programming must retain enough recent value history to maximize the score, count tied paths, and reconstruct the lexicographically smallest optimum.