mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-08 18:38:03 +00:00
Changed sys.maxint to sys.maxsize for Python 3 compatibility.
This commit is contained in:
@@ -34,10 +34,9 @@
|
||||
"source": [
|
||||
"## Constraints\n",
|
||||
"\n",
|
||||
|
||||
"* Can we assume this is a stack of ints?\n",
|
||||
" * Yes\n",
|
||||
"* If we call this function on an empty stack, can we return max int?\n",
|
||||
"* If we call this function on an empty stack, can we return maxsize?\n",
|
||||
" * Yes\n",
|
||||
"* Can we assume we already have a stack class that can be used for this problem?\n",
|
||||
" * Yes"
|
||||
@@ -158,7 +157,7 @@
|
||||
" assert_equal(stack.pop(), 1)\n",
|
||||
" assert_equal(stack.min(), 5)\n",
|
||||
" assert_equal(stack.pop(), 5)\n",
|
||||
" assert_equal(stack.min(), sys.maxint)\n",
|
||||
" assert_equal(stack.min(), sys.maxsize)\n",
|
||||
"\n",
|
||||
" print('Test: Pop empty stack')\n",
|
||||
" assert_equal(stack.pop(), None)\n",
|
||||
|
||||
Reference in New Issue
Block a user