#WEEKLY 7
h
Coder100 (6575)

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
AmazingMech2418 (841)

The only thing now is that there are duplicate subsets. For example, if you put in 1,1,1,1, it shows {1,1} 6 times.

Coder100 (6575)

ah yes thanks for reporting i will now make it remove duplicates @AmazingMech2418