Skip to main content
added 46 characters in body
Source Link
Neil
  • 177.3k
  • 12
  • 74
  • 281

JavaScript (ES6), 4646 45 bytes

f=(n,s,e)=>s<=e&&`$=>s<=e&&!!`${s++}`.includesmatch(n)+f(n,s,e)

(My best nonrecursive version was 61 bytes.) Edit: Saved 1 byte thanks to @edc65.

JavaScript (ES6), 46 bytes

f=(n,s,e)=>s<=e&&`${s++}`.includes(n)+f(n,s,e)

(My best nonrecursive version was 61 bytes.)

JavaScript (ES6), 46 45 bytes

f=(n,s,e)=>s<=e&&!!`${s++}`.match(n)+f(n,s,e)

(My best nonrecursive version was 61 bytes.) Edit: Saved 1 byte thanks to @edc65.

Source Link
Neil
  • 177.3k
  • 12
  • 74
  • 281

JavaScript (ES6), 46 bytes

f=(n,s,e)=>s<=e&&`${s++}`.includes(n)+f(n,s,e)

(My best nonrecursive version was 61 bytes.)