Skip to content

Commit

Permalink
Update leetcode todo list
Browse files Browse the repository at this point in the history
  • Loading branch information
guybrettrobertson committed Nov 7, 2020
1 parent c2981f4 commit 68fe563
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 196 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,104 +9,6 @@
"Problems found at [Leetcode website](https://leetcode.com/problemset/all/)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 31: Next permutation\n",
"Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.\n",
"\n",
"If such an arrangement is not possible, it must rearrange it as the lowest possible order (i.e., sorted in ascending order).\n",
"\n",
"The replacement must be in place and use only constant extra memory.\n",
"\n",
" \n",
"\n",
"Example 1:\n",
"\n",
"Input: nums = [1,2,3]\n",
"Output: [1,3,2]\n",
"\n",
"Example 2:\n",
"\n",
"Input: nums = [3,2,1]\n",
"Output: [1,2,3]\n",
"\n",
"Example 3:\n",
"\n",
"Input: nums = [1,1,5]\n",
"Output: [1,5,1]\n",
"\n",
"Example 4:\n",
"\n",
"Input: nums = [1]\n",
"Output: [1]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 32: Longest parentheses\n",
"\n",
"Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.\n",
"\n",
" \n",
"\n",
"Example 1:\n",
"\n",
"Input: s = \"(()\"\n",
"Output: 2\n",
"\n",
"Explanation: The longest valid parentheses substring is \"()\".\n",
"\n",
"Example 2:\n",
"\n",
"Input: s = \")()())\"\n",
"Output: 4\n",
"\n",
"Explanation: The longest valid parentheses substring is \"()()\".\n",
"\n",
"Example 3:\n",
"\n",
"Input: s = \"\"\n",
"Output: 0\n",
" \n",
"\n",
"Constraints:\n",
"\n",
"0 <= s.length <= 3 * 104\n",
"s[i] is '(', or ')'."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 33. Search in a rotated sorted array\n",
"\n",
"You are given an integer array nums sorted in ascending order, and an integer target.\n",
"\n",
"Suppose that nums is rotated at some pivot unknown to you beforehand (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).\n",
"\n",
"If target is found in the array return its index, otherwise, return -1.\n",
"\n",
"Example 1:\n",
"\n",
"Input: nums = [4,5,6,7,0,1,2], target = 0\n",
"Output: 4\n",
"\n",
"Example 2:\n",
"\n",
"Input: nums = [4,5,6,7,0,1,2], target = 3\n",
"Output: -1\n",
"\n",
"Example 3:\n",
"\n",
"Input: nums = [1], target = 0\n",
"Output: -1"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
98 changes: 0 additions & 98 deletions problem_solving/leetcode_problems/leetcode_problems_todo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,104 +9,6 @@
"Problems found at [Leetcode website](https://leetcode.com/problemset/all/)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 31: Next permutation\n",
"Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.\n",
"\n",
"If such an arrangement is not possible, it must rearrange it as the lowest possible order (i.e., sorted in ascending order).\n",
"\n",
"The replacement must be in place and use only constant extra memory.\n",
"\n",
" \n",
"\n",
"Example 1:\n",
"\n",
"Input: nums = [1,2,3]\n",
"Output: [1,3,2]\n",
"\n",
"Example 2:\n",
"\n",
"Input: nums = [3,2,1]\n",
"Output: [1,2,3]\n",
"\n",
"Example 3:\n",
"\n",
"Input: nums = [1,1,5]\n",
"Output: [1,5,1]\n",
"\n",
"Example 4:\n",
"\n",
"Input: nums = [1]\n",
"Output: [1]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 32: Longest parentheses\n",
"\n",
"Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.\n",
"\n",
" \n",
"\n",
"Example 1:\n",
"\n",
"Input: s = \"(()\"\n",
"Output: 2\n",
"\n",
"Explanation: The longest valid parentheses substring is \"()\".\n",
"\n",
"Example 2:\n",
"\n",
"Input: s = \")()())\"\n",
"Output: 4\n",
"\n",
"Explanation: The longest valid parentheses substring is \"()()\".\n",
"\n",
"Example 3:\n",
"\n",
"Input: s = \"\"\n",
"Output: 0\n",
" \n",
"\n",
"Constraints:\n",
"\n",
"0 <= s.length <= 3 * 104\n",
"s[i] is '(', or ')'."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 33. Search in a rotated sorted array\n",
"\n",
"You are given an integer array nums sorted in ascending order, and an integer target.\n",
"\n",
"Suppose that nums is rotated at some pivot unknown to you beforehand (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).\n",
"\n",
"If target is found in the array return its index, otherwise, return -1.\n",
"\n",
"Example 1:\n",
"\n",
"Input: nums = [4,5,6,7,0,1,2], target = 0\n",
"Output: 4\n",
"\n",
"Example 2:\n",
"\n",
"Input: nums = [4,5,6,7,0,1,2], target = 3\n",
"Output: -1\n",
"\n",
"Example 3:\n",
"\n",
"Input: nums = [1], target = 0\n",
"Output: -1"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 68fe563

Please sign in to comment.