We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Python3 Solution:
def pangrams(s):
string = s.lower()
for j in [chr(i) for i in range(ord('a'), ord('z') + 1)]:
if j not in string:
return('not pangram')
If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below:
my solutions
defpangrams(s:str):# Time complexity: O(n)# Space complexity (ignoring input): O(1)bit_mask=0forletterins.lower():if(letter<="z")and(letter>="a"):bit_pos=ord(letter)-ord("a")bit_mask|=1<<bit_posifbit_mask==(1<<26)-1:return"pangram"return"not pangram"defpangrams_not_elegant(s:str):# Time complexity: O(n)# Space complexity (ignoring input): O(1)dict_letters={}forletterins.lower():if(letter<="z")and(letter>="a")and(letternotindict_letters):dict_letters[letter]=1iflen(dict_letters)==26:return"pangram"return"not pangram"
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
C#
Python3 Solution: def pangrams(s): string = s.lower() for j in [chr(i) for i in range(ord('a'), ord('z') + 1)]: if j not in string: return('not pangram')
Rust best solution
If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below: my solutions
Python best solution
If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below: my solutions