Skip to main content
-6 thanks to @Shaggy
Source Link
noodle person
  • 12.6k
  • 1
  • 31
  • 90

Japt, 148 bytes

-6 thanks to @Shaggy

k â £è_¶X Vnü wmÊñn 

Try itTry it

I'm new to Japt so I'm sure this can be golfed way more. Particularly, I have n w to sort the occurrences in descending order but I think there's a shorter way, and I'm not sure â £è_¶X is the best way to get the number of occurrences of each element in an array. Please suggest any ways to improve the score!

k ü mÊñn k Get the prime factors of the input ü Group the factors to lists of the same element mÊ Map each group to its length ñn Sort them in descending order 

Japt, 14 bytes

k â £è_¶X Vn w 

Try it

I'm new to Japt so I'm sure this can be golfed way more. Particularly, I have n w to sort the occurrences in descending order but I think there's a shorter way, and I'm not sure â £è_¶X is the best way to get the number of occurrences of each element in an array. Please suggest any ways to improve the score!

Japt, 8 bytes

-6 thanks to @Shaggy

k ü mÊñn 

Try it

k ü mÊñn k Get the prime factors of the input ü Group the factors to lists of the same element mÊ Map each group to its length ñn Sort them in descending order 
Source Link
noodle person
  • 12.6k
  • 1
  • 31
  • 90

Japt, 14 bytes

k â £è_¶X Vn w 

Try it

I'm new to Japt so I'm sure this can be golfed way more. Particularly, I have n w to sort the occurrences in descending order but I think there's a shorter way, and I'm not sure â £è_¶X is the best way to get the number of occurrences of each element in an array. Please suggest any ways to improve the score!