[HackerRank][Python3] String Construction
2018. 9. 5. 00:31 |
프로그래밍/HackerRank
Problem :
https://www.hackerrank.com/challenges/string-construction/problem
My Solution :
#!/usr/bin/env python3 for _ in range(int(input())): print(len(set(input())))
Comment :
새로운 문자열이 들어올 때만 비용이 발생하므로 unique한 character의 갯수를 세어주면 된다.
'프로그래밍 > HackerRank' 카테고리의 다른 글
[HackerRank][Python3] Beautiful Triplets (0) | 2018.09.06 |
---|---|
[HackerRank][Python3] Equalize the Array (0) | 2018.09.06 |
[HackerRank][Python3] Jumping on the Clouds (0) | 2018.09.06 |
[HackerRank][Python3] Sequence Equation (0) | 2018.09.05 |
[HackerRank][Python3] Beautiful Binary String (0) | 2018.09.05 |
[HackerRank][Python3] Separate the Numbers (0) | 2018.09.04 |
[HackerRank][Python3] Weighted Uniform Strings (0) | 2018.09.04 |
[HackerRank][Python3] HackerRank in a String! (0) | 2018.09.03 |
최근에 달린 댓글 최근에 달린 댓글