Add Consecutive-Value Bonuses to Grid Paths

Quick Overview

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.

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.

|Home/Coding & Algorithms/OpenAI
OpenAI logo
OpenAI
Jun 11, 2026, 12:00 AM
mediumSoftware EngineerOnsiteCoding & Algorithms
0
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...