[HackerRank][Python3] Strong Password
2018. 6. 5. 00:50 |
프로그래밍/HackerRank
Problem :
https://www.hackerrank.com/challenges/strong-password/problem
My Solution :
#!/usr/bin/env python3 def minimumNumber(n, password): password = set(password) cnt = [0]*4 for c in password: if c.isdigit(): cnt[0] = 1 elif c.islower(): cnt[1] = 1 elif c.isupper(): cnt[2] = 1 else: cnt[3] = 1 if sum(cnt) == 4: break return max(4 - sum(cnt), 6 - n) n = int(input()) password = input() answer = minimumNumber(n, password) print(answer)
'프로그래밍 > HackerRank' 카테고리의 다른 글
[HackerRank][Python3] Recursive Digit Sum (0) | 2018.06.07 |
---|---|
[HackerRank][Python3] Sam and substrings (0) | 2018.06.06 |
[HackerRank][Python3] Marc's Cakewalk (0) | 2018.06.06 |
[HackerRank][Python3] Minimum Loss (0) | 2018.06.05 |
[HackerRank][Python3] Climbing the Leaderboard (0) | 2018.06.01 |
[HackerRank][Python3] The Power Sum (1) | 2018.05.31 |
[HackerRank][Python3] Construct the Array (0) | 2018.05.30 |
[HackerRank][Python3] Minimum Absolute Difference in an Array (0) | 2018.05.29 |
최근에 달린 댓글 최근에 달린 댓글