Skip to content

Commit 1f3698d

Browse files
nterview Preparation Kit --> Dictionaries and Hashmaps --> Hash-Tables--Ransom-Note
1 parent 3e2bd2c commit 1f3698d

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

HackerRank/Interview Preparation Kit/Dictionaries and Hashmaps/Dictionaries-and-Hashmaps.ipynb

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,52 @@
6060
" print()"
6161
]
6262
},
63+
{
64+
"cell_type": "markdown",
65+
"metadata": {},
66+
"source": [
67+
"# Hash Tables: Ransom Note\n",
68+
"![Hash Tables: Ransom Note](Hash-Tables--Ransom-Note.png)"
69+
]
70+
},
71+
{
72+
"cell_type": "code",
73+
"execution_count": 43,
74+
"metadata": {},
75+
"outputs": [
76+
{
77+
"name": "stdin",
78+
"output_type": "stream",
79+
"text": [
80+
" two times three is not four\n",
81+
" two times two is four\n"
82+
]
83+
},
84+
{
85+
"name": "stdout",
86+
"output_type": "stream",
87+
"text": [
88+
"No\n"
89+
]
90+
}
91+
],
92+
"source": [
93+
"from collections import Counter as C\n",
94+
"s1=input().split()\n",
95+
"s2=input().split()\n",
96+
"if C(s2)-C(s1)=={}:\n",
97+
" print('Yes')\n",
98+
"else:\n",
99+
" print('No')"
100+
]
101+
},
63102
{
64103
"cell_type": "code",
65104
"execution_count": null,
66105
"metadata": {},
67106
"outputs": [],
68107
"source": [
69-
"n=b"
108+
"n="
70109
]
71110
},
72111
{

0 commit comments

Comments
 (0)