Search
⌘K

Leetcode 2078. Two Furthest Houses With Different Colors

Given an array of house colors, return the maximum absolute index distance |i - j| between two houses with different colors. Essentially, find the farthest pair of indices whose color values differ (often achieved by comparing ends to the nearest differently colored house).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.