Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 40 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, 12(削除) 12 (削除ここまで) 11 bytes

Òγvy¬sg})1KJÒγvy¬sg×ばつJ

Try it online! Try it online!

Alternative 12 byte solutionExplanation

fIÓ0KÒ # calculate prime factors with duplicates
 γ # group consecutive equal elements
 vy # for each group
 ¬ # get the head without popping
 sg # push the length of the group
 ×ばつ # repeat the length (length != 1)øʒ1KJ? times
 J # join

05AB1E, 12 bytes

Òγvy¬sg})1KJ

Try it online!

Alternative 12 byte solution

fIÓ0K)øʒ1KJ?

05AB1E, (削除) 12 (削除ここまで) 11 bytes

Òγvy¬sg×ばつJ

Try it online!

Explanation

Ò # calculate prime factors with duplicates
 γ # group consecutive equal elements
 vy # for each group
 ¬ # get the head without popping
 sg # push the length of the group
 ×ばつ # repeat the length (length != 1) times
 J # join
deleted 323 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, 12 bytes

Ó0KIfÒγvy¬sg})øʒ1KJ?1KJ

Try it online! Try it online!

Explanation Alternative 12 byte solution

Ó # calculate prime factor exponents of input
 0K # remove zeroes
 If # calculate unique prime factors of input
 fIÓ0K)ø # zip together
 ʒ # filter list
 1K # remove ones
 Jøʒ1KJ? # join and print

05AB1E, 12 bytes

Ó0KIf)øʒ1KJ?

Try it online!

Explanation

Ó # calculate prime factor exponents of input
 0K # remove zeroes
 If # calculate unique prime factors of input
 )ø # zip together
 ʒ # filter list
 1K # remove ones
 J? # join and print

05AB1E, 12 bytes

Òγvy¬sg})1KJ

Try it online!

Alternative 12 byte solution

fIÓ0K)øʒ1KJ?
added 323 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, 12 bytes

Ó0KIf)øʒ1KJ?

Try it online!

Explanation

Ó # calculate prime factor exponents of input
 0K # remove zeroes
 If # calculate unique prime factors of input
 )ø # zip together
 ʒ # filter list
 1K # remove ones
 J? # join and print

05AB1E, 12 bytes

Ó0KIf)øʒ1KJ?

Try it online!

05AB1E, 12 bytes

Ó0KIf)øʒ1KJ?

Try it online!

Explanation

Ó # calculate prime factor exponents of input
 0K # remove zeroes
 If # calculate unique prime factors of input
 )ø # zip together
 ʒ # filter list
 1K # remove ones
 J? # join and print
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164
Loading

AltStyle によって変換されたページ (->オリジナル) /