Skip to content

Commit 0951589

Browse files
committed
solved xor problem
1 parent e93ca48 commit 0951589

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

leetcode_kuro_RnD.ipynb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8895,15 +8895,14 @@
88958895
},
88968896
{
88978897
"cell_type": "code",
8898-
"execution_count": 119,
8898+
"execution_count": 4,
88998899
"metadata": {},
89008900
"outputs": [
89018901
{
89028902
"name": "stdout",
89038903
"output_type": "stream",
89048904
"text": [
8905-
"101\n",
8906-
"['101', '10', '0', '11', '1']\n"
8905+
"[5, 7, 2, 3, 2]\n"
89078906
]
89088907
}
89098908
],
@@ -8918,7 +8917,11 @@
89188917
"\n",
89198918
"# pref_bin = [bin(i).replace(\"0b\",\"\") for i in pref]\n",
89208919
"# print(pref_bin)\n",
8921-
"\n"
8920+
"\n",
8921+
"for i in range(len(pref)-1,0,-1):\n",
8922+
" pref[i]^=pref[i-1]\n",
8923+
"\n",
8924+
"print(pref)"
89228925
]
89238926
},
89248927
{

0 commit comments

Comments
 (0)