A dashboard lets users drag its panels into any order. QA wants to test every order. The panels have distinct numeric IDs in ids.
Write allPanelOrders(ids) that returns every order of the IDs, each as an array. The orders may be listed in any order, but each must appear exactly once.
Input: ids = [7,8] Output: [[7,8],[8,7]]
Either panel can come first.
Input: ids = [5] Output: [[5]]
One panel has one order.
0 <= ids.length <= 6Run tries your code on the examples. Submit runs every test, including hidden edge cases, and solves the problem when they all pass.
Ctrl + Enter runs, Ctrl + Shift + Enter submits (⌘ on a Mac).
I'm here to help with #297 Every Panel Order. I give hints, never the solution, so you get to solve it yourself. Ask for a hint, select code to ask about it, or press Ask Tuto why on a failing test.
Your first 3 answers need no account. for free to keep asking.