Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kranz912 committed May 6, 2020
1 parent e29e79a commit dafbe91
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
31 changes: 31 additions & 0 deletions 6-CheckMissingPangramChar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'''
Pangram is a sentence containing every letter in the English alphabet. Given a string, find all characters that are missing from the string, i.e., the characters that can make string a Pangram. We need to print output in alphabetic order.
Examples:
Input : welcome to geeksforgeeks
Output : abdhijnpquvxyz
Input : The quick brown fox jumps
Output : adglvyz
'''

letter = 'a'
alphabet = []


for index in range(0,26):
alphabet.append(letter)
letter = chr(ord(letter)+1)


def CheckMissingCharacters(S):
S = S.lower()
for s in S:
if s.isalpha():
if s in alphabet:
alphabet.remove(s)

return "".join(alphabet)

print(CheckMissingCharacters("The quick brown fox jumps over the lazy do"))
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,33 @@ def checkPangram(S):
print(checkPangram("The quick brown fox jumps over the lazy dog"))

```


### 6. Check Pangram Missing Characters
Pangram is a sentence containing every letter in the English alphabet. Given a string, find all characters that are missing from the string, i.e., the characters that can make string a Pangram. We need to print output in alphabetic order.

```
Examples:
Input : welcome to geeksforgeeks
Output : abdhijnpquvxyz
Input : The quick brown fox jumps
Output : adglvyz
```



#### Solution
``` python
def checkPangram(S):
dict = {}
S= S.lower()
for s in S:
if s.isalpha():
dict.update({s:1})
return len(dict) ==26

print(checkPangram("The quick brown fox jumps over the lazy dog"))

```

0 comments on commit dafbe91

Please sign in to comment.