Create a function which accepts one arbitrary string as an argument, and return a string of length 26. The objective is to set each of the 26 chara...
For further actions, you may consider blocking this person and/or reporting abuse
C++17
This is a one statement in JS that works:
Here is a C++ solution,
Rust
yay fun with bitsets
// "Test"
On infinitely long strings it would be good to:
0b11111111111111111111111111
but on such short strings these would both be slower
Edit:
I have stolen the ascii case sensitivity bit from @miketalbot and will now proceed to pleasure myself with this fish
Is this actually faster?
No idea.
Alternatively
or even just
🤷
Python 3.7
Try it online!
(Sorry. I didn’t manage for format the code in markdown properly on my iphone)I had roughly the same idea:
Here is a Ruby solution
Here is the Python solution:
Thanks for the challenge!
There's also
String.prototype.includes
Thanks Michael, I like that better.