Skip to main content
Commonmark migration
Source Link

#05AB1E, 16 14 13 11 10 bytes

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)

#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)

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)
added 187 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#05AB1E, 16 14 13 1111 10 bytes

3L×0KJ‚€∞×0KJ‚€{íË

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

Try it online-1 byte thanks to @Grimy.

Try it online or verify all test casesverify all test cases.

Explanation:

3L           # Push thean infinite positive list: [1,2,3]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)

#05AB1E, 16 14 13 11 bytes

3L×0KJ‚€{íË

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

Try it online or verify all test cases.

Explanation:

3L           # Push the list [1,2,3]
  ×          # Repeat the values in the (implicit) input-list that many times as string
   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)

#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)
deleted 160 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#05AB1E, 16 14 13 13 11 bytes

ćs3L×0KJ‚€3L×0KJ‚€{íË

InputTakes the medals input in the order is [reputation, bronze_medals[bronze, silver_medalssilver, gold_medals]gold] as first input, and reputation as second input.

Try it onlineTry it online or verify all test casesverify all test cases.

Explanation:

ć              # Extract the head of the (implicit) input-list;
               # pop the list and push the remainder-list and head separately to the stack
 s             # Swap to get the remainder-list at the top again
  3L           # Push the list [3[1,2,1]3]
    ×          # Repeat the remaindervalues in the (implicit) input-numberslist that many times as string
     0K        # Remove all 0s (so all "0", "00" and "000")
       J       # Join the strings in the list together
        ‚      # Pair this string with the head
(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)

#05AB1E, 16 14 13 bytes

ćs3L×0KJ‚€{íË

Input order is [reputation, bronze_medals, silver_medals, gold_medals].

Try it online or verify all test cases.

Explanation:

ć              # Extract the head of the (implicit) input-list;
               # pop the list and push the remainder-list and head separately to the stack
 s             # Swap to get the remainder-list at the top again
  3L           # Push the list [3,2,1]
    ×          # Repeat the remainder-numbers that many times as string
     0K        # Remove all 0s (so all "0", "00" and "000")
       J       # Join the strings in the list together
        ‚      # Pair this string with the head
         €{í   # 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)

#05AB1E, 16 14 13 11 bytes

3L×0KJ‚€{íË

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

Try it online or verify all test cases.

Explanation:

3L           # Push the list [1,2,3]
  ×          # Repeat the values in the (implicit) input-list that many times as string
   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)
added 72 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading
deleted 93 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading