#Leetcode

13 messages · Page 1 of 1 (latest)

boreal mica
#

I am doing leetcode problems and the runtime of my solution is 0 but memory consumption is higher.
I am not getting other ways to improve this program.
How can I improve this PANGRAM program.

marsh starBOT
#

This post has been reserved for your question.

Hey @boreal mica! Please use /close or the Close Post button 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.

scenic jetty
#

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

radiant mountain
tulip schooner
#

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’

marsh starBOT
#

💤 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.