Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions math_probability/math_ops/math_ops_challenge.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Challenge Notebook"
"# *Challenge Notebook:*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Problem: Create a class with an insert method to insert an int to a list. It should also support calculating the max, min, mean, and mode in O(1).\n",
"## *Problem: Create a class with an insert method to insert an int to a list. It should also support calculating the max, min, mean, and mode in O(1).*\n",
"\n",
"* [Constraints](#Constraints)\n",
"* [Test Cases](#Test-Cases)\n",
Expand All @@ -32,7 +32,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Constraints\n",
"## *Constraints:*\n",
"\n",
"* Can we assume the inputs are valid?\n",
" * No\n",
Expand All @@ -52,7 +52,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Test Cases\n",
"## *Test Cases*\n",
"\n",
"* None -> TypeError\n",
"* [] -> ValueError\n",
Expand Down Expand Up @@ -85,13 +85,14 @@
"metadata": {},
"outputs": [],
"source": [
"#Solution Class\n",
"class Solution(object):\n",
"\n",
" def __init__(self, upper_limit=100):\n",
" def __init__(self, upper_limit=100): # init method constructor\n",
" # TODO: Implement me\n",
" pass\n",
"\n",
" def insert(self, val):\n",
" def insert(self, val): # insert method \n",
" # TODO: Implement me\n",
" pass"
]
Expand Down Expand Up @@ -120,7 +121,7 @@
"import unittest\n",
"\n",
"\n",
"class TestMathOps(unittest.TestCase):\n",
"class TestMathOps(unittest.TestCase): #define a class\n",
"\n",
" def test_math_ops(self):\n",
" solution = Solution()\n",
Expand All @@ -143,7 +144,7 @@
" print('Success: test_math_ops')\n",
"\n",
"\n",
"def main():\n",
"def main(): # method\n",
" test = TestMathOps()\n",
" test.test_math_ops()\n",
"\n",
Expand Down