mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-05 00:48:03 +00:00
Fix typos (#191)
This commit is contained in:
committed by
Donne Martin
parent
cd9e9654bc
commit
9f89a51aba
@@ -112,7 +112,7 @@
|
||||
" self.mean = None\n",
|
||||
" # Mode\n",
|
||||
" self.array = [0] * (upper_limit + 1)\n",
|
||||
" self.mode_ocurrences = 0\n",
|
||||
" self.mode_occurrences = 0\n",
|
||||
" self.mode = None\n",
|
||||
"\n",
|
||||
" def insert(self, val):\n",
|
||||
@@ -128,8 +128,8 @@
|
||||
" self.mean = self.running_sum / self.num_items\n",
|
||||
" # Calculate the mode\n",
|
||||
" self.array[val] += 1\n",
|
||||
" if self.array[val] > self.mode_ocurrences:\n",
|
||||
" self.mode_ocurrences = self.array[val]\n",
|
||||
" if self.array[val] > self.mode_occurrences:\n",
|
||||
" self.mode_occurrences = self.array[val]\n",
|
||||
" self.mode = val"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
"\n",
|
||||
"borrow = (~a&b) << 1 = 0010\n",
|
||||
"\n",
|
||||
"If the borrow is not zero, we'll need to subtract the borrow from the result. Recusively call the function, passing in result and borrow.\n",
|
||||
"If the borrow is not zero, we'll need to subtract the borrow from the result. Recursively call the function, passing in result and borrow.\n",
|
||||
"\n",
|
||||
"Complexity:\n",
|
||||
"* Time: O(b), where b is the number of bits\n",
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
"\n",
|
||||
"carry = (a&b) << 1 = 1010\n",
|
||||
"\n",
|
||||
"If the carry is not zero, we'll need to add the carry to the result. Recusively call the function, passing in result and carry.\n",
|
||||
"If the carry is not zero, we'll need to add the carry to the result. Recursively call the function, passing in result and carry.\n",
|
||||
"\n",
|
||||
"Below are the values of a, b, and the carry of a = 7 and b = 5, producing the result of 12.\n",
|
||||
"\n",
|
||||
|
||||
Reference in New Issue
Block a user