Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added python solutions for Day 4 (#51)
* Add @vishalshirke7 as a contributor * Update @vishalshirke7 as a contributor * Added python solutions for Day 4 * modified readme * Add @Vishal * reverted adding as a contributor * Update README.md * Update CONTRIBUTORS.md * Update CONTRIBUTORS.md
- Loading branch information
1 parent
dead695
commit ca321c1
Showing
3 changed files
with
157 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" | ||
@author : vishalshirke7 | ||
@date : 25/12/2018 | ||
""" | ||
|
||
input_str = input() | ||
dictnry = {} | ||
maxCount, maxChar = 0, '' | ||
for char in input_str: | ||
if char in dictnry.keys(): | ||
dictnry[char] += 1 | ||
else: | ||
dictnry[char] = 1 | ||
if dictnry[char] > maxCount: | ||
maxCount = dictnry[char] | ||
maxChar = char | ||
|
||
print(maxChar) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import re | ||
|
||
""" | ||
@author : vishalshirke7 | ||
@date : 25/12/2018 | ||
""" | ||
|
||
""" | ||
This solution is based on regular expression module in python. | ||
""" | ||
|
||
print(len(re.findall(r'[a,e,i,o,u,A,E,I,O,U]', input()))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters