Skip to content

Modified math_ops_challenge.ipynb #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy