Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 667. Beautiful Arrangement II
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.