← Atlassian questions
CodingHard

Binary partition based on direction array

Filed under Atlassian

The question

Given an array of 'L' and 'R' directions of size N, perform a binary search-like partitioning N times. Start with a range [1, 2^N], and for each step, insert the current index into the result and narrow the range to the left or right half based on the direction.

No write-up yet. Related questions below have one.

Related Atlassian questions

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