Available question text
Construct a permutation of 1..n such that the multiset of absolute differences between consecutive elements contains exactly k distinct values. The typical challenge is to design a sequence (commonly by alternating low/high to produce k distinct gap sizes, then filling the remainder sequentially) that yields precisely k distinct adjacent differences.
Related questions
Continue with questions that share topics or the same question type.
- Beautiful Arrangement
Coding · Array · Backtracking · Bit Manipulation
- Beautiful Array
Coding
- Beautiful Pairs
Coding
- Beautiful Towers I
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 667. Beautiful Arrangement II
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source