Skip to content

Commit 2cfccd1

Browse files
committed
Added unique-char-check
1 parent f815175 commit 2cfccd1

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
Question
3+
You are given a string S, check if all characters are unique.
4+
5+
SAMPLE INPUT 1
6+
abcd
7+
SAMPLE OUTPUT 1
8+
True
9+
10+
SAMPLE INPUT 2
11+
aabc
12+
SAMPLE OUTPUT 2
13+
False
14+
"""
15+
from collections import Counter
16+
def unique_char_check(S):
17+
character_count = Counter(S)
18+
19+
if len(character_count) == len(S):
20+
return True
21+
return False
22+
23+
S = input()
24+
print(unique_char_check(S))

0 commit comments

Comments
 (0)