Skip to main content
1 of 5
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#05AB1E, 8 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 a range from the second to first input (inclusive on both sides)
            #  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
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384