Skip to main content
3 of 5
added 612 characters in body
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#05AB1E, 8 (or 10?) bytes

ŸʒRS3ôOË

Try it online or verify some more test cases.

NOTE: In 05AB1E strings and integers are interchangeable, so the output numbers doesn't contain leading zeroes.

Explanation:

Ÿ           # Create an inclusive (on both sides) range from the two inputs
            #  i.e. 038920 and 038910 → 
            #   [38910,38911,38912,38913,38914,38915,38916,38917,38918,38919,38920]
 ʒ          # Filter this list by:
  R         #  Reverse the number (the reverse is because the numbers lack leading zeroes)
            #   i.e. 38910 → '01983'
   S        #  Transform it to a list of digits
            #   i.e. '01983' → ['0','1','9','8','3']
    3ô      #  Split it into chunks of length 3
            #   i.e. ['0','1','9','8','3'] → [['0','1','9'],['8','3']]
      O     #  Sum the digits in both parts
            #   i.e. [['0','1','9'],['8','3']] → [10,11]
       Ë    #  Check if they are equal (if they are, they remain in the filtered list)
            #   i.e. [10,11] → 0

EDIT: Seems I (and most other answers) slightly misread the challenge and the amount of numbers is being asked instead of the numbers themselves within the range. In that case a leading }g can be added (close the filter; and get the amount of numbers left in the filtered list), so it's 10 bytes instead:

ŸʒRS3ôOË}g

Try it online or verify some more test cases.

Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384