Skip to main content
6 of 6
Commonmark migration

05AB1E, 16 14 13 11 10 bytes

∞×0KJ‚€{íË

Takes the medals input in the order [bronze, silver, gold] as first input, and reputation as second input.

-1 byte thanks to @Grimy.

Try it online or verify all test cases.

Explanation:

∞           # Push an infinite positive list: [1,2,3,...]
 ×          # Repeat the values in the (implicit) input-list that many times as string
            # (since the input-list contains just 3 values, the rest of the infinite
            #  list is ignored)
  0K        # Remove all 0s (so all "0", "00" and "000")
    J       # Join the strings in the list together
     ‚      # Pair this string with the (implicit) second input
      €{í   # Sort the digits in both strings in descending order
         Ë  # And check if both are now equal
            # (after which the result is output implicitly as result)
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384