We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71ce1ce commit bd36c9aCopy full SHA for bd36c9a
first_recurring_character.py
@@ -0,0 +1,16 @@
1
+def first_recurring_character(input):
2
+ flag = None
3
+ d = dict()
4
+ for char in input:
5
+ if char in d.keys():
6
+ flag = char
7
+ return flag
8
+ d[char] = 1
9
10
+
11
+result = first_recurring_character("DFGHJWERGBFGHJ")
12
+print(result) # G
13
+result = first_recurring_character("ABCDEFGH")
14
+print(result) # None
15
+result = first_recurring_character("12345642124345")
16
+print(result) # 4
0 commit comments