Check if string has all the letters of the alphabet

前端 未结 15 1288
终归单人心
终归单人心 2020-12-19 17:51

What would be the best logic to check all the letters in a given string.

If all the 26 letters are available in the provided string, I want to check that and perform

15条回答
  •  [愿得一人]
    2020-12-19 18:06

    I'd go for a bitmap. If you increment a counter each time you set an entry in the bitmap to 1, you can early return as soon as you've seen all the letters. I hope this is not for enforcing password requirements.

提交回复
热议问题