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 6357a8f commit 621343aCopy full SHA for 621343a
src/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/frequency_queries.py
@@ -9,6 +9,9 @@
9
__DELETE__ = 2
10
__SELECT__ = 3
11
12
+__NOT_FOUND__ = 0
13
+__FOUND__ = 1
14
+
15
16
def freq_query(queries):
17
result = []
@@ -26,10 +29,10 @@ def freq_query(queries):
26
29
elif operation == __SELECT__:
27
30
for value in data_map.values():
28
31
if value == data:
- result.append(1)
32
+ result.append(__FOUND__)
33
break
34
else:
- result.append(0)
35
+ result.append(__NOT_FOUND__)
36
37
raise ValueError('Invalid operation')
38
0 commit comments