#WEEKLY 7
h
Coder100 (6468)

WEEKLY 7

Hello everyone! I did it! I thought about the challenge all night yesterday (even while dreaming) and so here's the solution!

Enjoy! The golfed version is in yeet.js. As always, I have added colors to the output!

Walkthrough

I made a log of the occurrences of each number, and then removed the ones that had only 1 occurrence. The rest were then made into an array using a magical Array.fill() technique and then Array.concated together.
update
I made a log of the occurrences of each number, and then removed the ones that had only 1 occurrence. The rest were then made into an array using a magical Array.fill() technique and then Array.concated together. After that, I found all the subsets of that array and then removed the ones that didn't fit the requirements. The process is actually quite fast in my opinion!

Have a great day!

Yeet

Updates

You are viewing a single comment. View All
DynamicSquid (3229)

@AmazingMech2418

I said:

Is [2, 2] another answer?

And he said:

yes that's right, I'm pretty sure it already said there can be multiple and you have to print all such subsets. Although, [] is optional as technically it's always valid regardless of the original array.