#Leetcode
13 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @boreal mica! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
so you need to check whether every letter of the alphabet is contained in the string?
theoretically, you could use a bit set with one bit per character
then iterate over the string once and set all bits where the character is present
and then check all entries of the bit set
whether there's a single character that's missing
or, since lowercase a-z characters has codes from 97 to 122, you could just iterate through this range and each character check for presence in the sentence
Yeah, to expound on that, doing myChar++ moves it to the next ascii value. All lowercase letters are alphabetically sequential in ascii, so you only need to store 1 char at a time.
‘a’+=1 == ‘b’
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
thanq so much bro
thanq brother it really helped me