Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

saved 6 bytes
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 5246 bytes

Saved 6 bytes thanks to @Neil

Expects (D)(c), where D is a string of digits and c is an integer.

D=>c=>eval(`for(k=0;;/[^${D}]/.test(kc)|k%256-c;;)++k`c+=256;c`)

Try it online! Try it online!

JavaScript (ES6), 52 bytes

Expects (D)(c), where D is a string of digits and c is an integer.

D=>c=>eval(`for(k=0;/[^${D}]/.test(k)|k%256-c;)++k`)

Try it online!

JavaScript (ES6), 46 bytes

Saved 6 bytes thanks to @Neil

Expects (D)(c), where D is a string of digits and c is an integer.

D=>c=>eval(`for(;/[^${D}]/.test(c);)c+=256;c`)

Try it online!

saved 6 bytes
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 5852 bytes

Expects (D)(c), where D is a string of digits and c is an integer.

D=>c=>eval("for`for(k=0;(k+D).match(`[^$/[^${D}]`]/.test(k)||k%256|k%256-c;)++k"++k`)

Try it online! Try it online!

JavaScript (ES6), 58 bytes

Expects (D)(c), where D is a string of digits and c is an integer.

D=>c=>eval("for(k=0;(k+D).match(`[^${D}]`)||k%256-c;)++k")

Try it online!

JavaScript (ES6), 52 bytes

Expects (D)(c), where D is a string of digits and c is an integer.

D=>c=>eval(`for(k=0;/[^${D}]/.test(k)|k%256-c;)++k`)

Try it online!

saved 1 byte
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 5958 bytes

Expects (D)(c), where D is a string of digits and c is an integer.

D=>c=>eval("for(k=0;(++k+Dk+D).match(`[^${D}]`)||k%256-c;);k"++k")

Try it online! Try it online!

JavaScript (ES6), 59 bytes

Expects (D)(c), where D is a string of digits and c is an integer.

D=>c=>eval("for(k=0;(++k+D).match(`[^${D}]`)||k%256-c;);k")

Try it online!

JavaScript (ES6), 58 bytes

Expects (D)(c), where D is a string of digits and c is an integer.

D=>c=>eval("for(k=0;(k+D).match(`[^${D}]`)||k%256-c;)++k")

Try it online!

Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading

AltStyle によって変換されたページ (->オリジナル) /