Skip to main content
4 of 7
added 1455 characters in body
Kevin Cruijssen
  • 131.5k
  • 13
  • 144
  • 384

#05AB1E, 15 13 bytes

₄4°Ÿʒ0å}ʒSO9Q

-2 bytes thanks to @Emigna.

Try it online.

Explanation:

₄4°Ÿ             # List in the range [1000,10000]
    ʒ  }         # Filter this list by:
     0å          #  The number contains a 0
        ʒ        # Filter the filtered list further by:
         SO9Q    #  The sum of its digits is exactly 9

13-bytes alternative:

₄4°ŸʒW_sSO9Q*

Try it online.

Explanation:

₄4°Ÿ             # List in the range [1000,10000]
    ʒ            # Filter this list by:
     W_          #  Take the minimum digit (without popping), and check if it's a 0
            *    #  And
       sSO9Q     #  Where the sum of its digits is exactly 9

And yet another 13-bytes alternative:

4°Lʒ0å}ʒÇOт·-

Credit for this alternative goes to @Mr.Xcoder.

Try it online.

Explanation:

4°L              # List in the range [1,10000]
   ʒ  }          # Filter this list by:
    0å           #  The number contains a 0
       ʒ         # Filter the filtered list further by:
        Ç        #  Convert the digits to unicode values
         O       #  Take the sum
          т·-    #  Subtract 200 (Only 1 is truthy in 05AB1E, and the sum of digits
                 #                as unicode values equaling 9 is 201)
Kevin Cruijssen
  • 131.5k
  • 13
  • 144
  • 384