Tweaked constraints section discussion.

This commit is contained in:
Donne Martin 2015-07-06 06:03:09 -04:00
parent d236679338
commit fac7bbb1be
60 changed files with 60 additions and 120 deletions

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",

View File

@ -35,8 +35,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* For simplicity, are the keys integers only?\n",
" * Yes\n",
"* For collision resolution, can we use linked lists?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* For simplicity, are the keys integers only?\n",
" * Yes\n",
"* For collision resolution, can we use linked lists?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",

View File

@ -35,8 +35,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can I assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",

View File

@ -36,8 +36,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can I assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can you assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can you assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can you assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",

View File

@ -37,8 +37,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can you assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Do you expect the return to be in reverse order too?\n",
" * Yes\n",
"* What if one of the inputs is None?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Do you expect the return to be in reverse order too?\n",
" * Yes\n",
"* What if one of the inputs is None?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* What if the final node is being deleted, for example a single node list? Do we make it a dummy with value None?\n",
" * Yes\n",
"* Can we assume we already have a linked list class that can be used for this problem?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* What if the final node is being deleted, for example a single node list? Do we make it a dummy with value None?\n",
" * Yes\n",
"* Can we assume we already have a linked list class that can be used for this problem?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is this a singly linked list?\n",
" * Yes\n",
"* Can we assume we are always passed a circular linked list?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is this a singly linked list?\n",
" * Yes\n",
"* Can we assume we are always passed a circular linked list?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we assume k is a valid integer?\n",
" * Yes\n",
"* If k = 0, does this return the last element?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we assume k is a valid integer?\n",
" * Yes\n",
"* If k = 0, does this return the last element?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is this a singly or doubly linked list?\n",
" * Singly\n",
"* Is this a circular list?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is this a singly or doubly linked list?\n",
" * Singly\n",
"* Is this a circular list?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is a single character or number a palindrome?\n",
" * No\n",
"* Can we assume we already have a linked list class that can be used for this problem?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is a single character or number a palindrome?\n",
" * No\n",
"* Can we assume we already have a linked list class that can be used for this problem?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we create additional data structures?\n",
" * Yes\n",
"* Do you expect the function to return a new list?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we create additional data structures?\n",
" * Yes\n",
"* Do you expect the function to return a new list?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is this a singly or doubly linked list?\n",
" * Singly\n",
"* Can you insert None values in the list?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is this a singly or doubly linked list?\n",
" * Singly\n",
"* Can you insert None values in the list?\n",

View File

@ -36,8 +36,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"See the [HackerRank problem page](https://www.hackerrank.com/challenges/maximizing-xor)."
]
},

View File

@ -35,8 +35,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"See the [HackerRank problem page](https://www.hackerrank.com/challenges/maximizing-xor)."
]
},

View File

@ -36,8 +36,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"See the [HackerRank problem page](https://www.hackerrank.com/challenges/utopian-tree)."
]
},

View File

@ -35,8 +35,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"See the [HackerRank problem page](https://www.hackerrank.com/challenges/utopian-tree)."
]
},

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* None"
]
},

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* None"
]
},

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is a naiive solution sufficient?\n",
" * Yes"
]

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is a naiive solution sufficient?\n",
" * Yes"
]

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is a naiive solution sufficient?\n",
" * Yes"
]

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is a naiive solution sufficient?\n",
" * Yes"
]

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is a naiive solution sufficient (ie not in-place)?\n",
" * Yes"
]

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is a naiive solution sufficient (ie not in-place)?\n",
" * Yes"
]

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is a naiive solution sufficient (ie not stable, not based on a heap)?\n",
" * Yes"
]

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is a naiive solution sufficient (ie not stable, not based on a heap)?\n",
" * Yes"
]

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we assume we already have a stack class that can be used for this problem?\n",
" * Yes"
]

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we assume we already have a stack class that can be used for this problem?\n",
" * Yes"
]

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Are the stacks and array a fixed size?\n",
" * Yes"
]

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Are the stacks and array a fixed size?\n",
" * Yes"
]

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Do you expect the methods to be enqueue and dequeue?\n",
" * Yes\n",
"* Can we assume we already have a stack class that can be used for this problem?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Do you expect the methods to be enqueue and dequeue?\n",
" * Yes\n",
"* Can we assume we already have a stack class that can be used for this problem?\n",

View File

@ -35,8 +35,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* If there is one item in the list, do you expect the first and last pointers to both point to it?\n",
" * Yes\n",
"* If there are no items on the list, do you expect the first and last pointers to be None?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* If there is one item in the list, do you expect the first and last pointers to both point to it?\n",
" * Yes\n",
"* If there are no items on the list, do you expect the first and last pointers to be None?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we assume we already have a stack class that can be used for this problem?\n",
" * Yes\n",
"* If a stack becomes full, we should automatically create one?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Can we assume we already have a stack class that can be used for this problem?\n",
" * Yes\n",
"* If a stack becomes full, we should automatically create one?\n",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* When sorted, should the largest element be at the top or bottom?\n",
" * Top\n",
"* Can you have duplicate values like 5, 5?\n",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* When sorted, should the largest element be at the top or bottom?\n",
" * Top\n",
"* Can you have duplicate values like 5, 5?\n",

View File

@ -35,8 +35,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* None"
]
},

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* None"
]
},

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\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",

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\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",

View File

@ -34,8 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is it foo or bar?\n",
" * foo"
]

View File

@ -33,8 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n",
"\n",
"* Is it foo or bar?\n",
" * foo"
]