Algorithm · Amazon · Hard
For each task below, design and implement an efficient solution. Part 1: Straight-Line Student Arrangements Given a list students of distinct integer IDs, return every possible ordering of those students in a line. The returned list must be deterministic: order the arrangements lexicographically with respect to the order in which the IDs appear in students. An ID that appears earlier in students is treated as smaller for this ordering. Example 1: Explanation: These are the…
Checking your access…