Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function uniqueSequences(input) {
- const storedArrs = new Set();
- input.forEach((arr) => {
- const sortArr = JSON.parse(arr).sort((a, b) => b - a);
- storedArrs.add(JSON.stringify(sortArr));
- });
- const resArr = [];
- [...storedArrs].forEach((el) => resArr.push(JSON.parse(el)));
- resArr.sort((a, b) => a.length - b.length);
- resArr.forEach((a) => console.log(`[${a.join(', ')}]`));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement