Ad
  • Default User Avatar

    bruh I forgor the print there 🤡

  • Default User Avatar

    I don't know why people mark this as clever, to me it's clearly best practices as I'd prefer this code over other answers in production because it's clean and small enough to grasp immediately. Though you missed +1 at list generation:

    (i) => interval[0] + i // all elements will be smaller than actual ones in the interval by one
    

    which should be as the following:

    (i) => interval[0] + 1 + i
    

    But it doesn't really matter, the code works correctly and it's fine.