← Salesforce questions

Maximum Length Path with Adjacent Difference Constraints

Filed under Salesforce

Given a 2D matrix, find the maximum length of a path starting from (0,0) moving only right or down, where each step (r, c) to (nr, nc) is valid only if |matrix[r][c] - matrix[nr][nc]| == 1.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Salesforce questions

Collected from public candidate posts and coding forums. Updated Nov 2026.