Skip to content

Instantly share code, notes, and snippets.

@leetcode-notes
Last active January 20, 2021 15:38
Show Gist options
  • Save leetcode-notes/524abccf2c6cb77dba2bb3b1079b0404 to your computer and use it in GitHub Desktop.
Save leetcode-notes/524abccf2c6cb77dba2bb3b1079b0404 to your computer and use it in GitHub Desktop.

8/29/20 (Sliding Window)

8/27/20 (Binary Search)

8/24/20 (DP)

8/22/20 (DP)

8/20/20 (backtracking)

8/16/20 https://leetcode.com/problems/unique-paths-iii Use recursive search to count the valid paths. A path is valid if all of the non-obstacle cells have been visited exactly once. We check if remain == 1, since remain is the count of non-obstacle cells and a valid path should only have 1 cell left unvisited (the target cell).

https://leetcode.com/problems/confusing-number-ii/ Use backtracking to try all possible numbers. Whenever a number is not equal to its rotation, increment the total count. Then try to add other valid rotation digits to the current number and determine if the result is a confusing number.

6/21/20

6/20/20

6/17/20

6/16/20

6/15/20

6/14/20

6/8/20 https://leetcode.com/problems/shuffle-the-array/ https://leetcode.com/problems/find-lucky-integer-in-an-array/ 5/30/20

5/23/20

5/16/20

Three problems from weekly contest 189

5/15/20

5/14/20

@leetcode-notes
Copy link
Author

The explanation for each problem is very brief, basically enough information for me to quickly remember what the key points to the algorithm are. A detailed interview style explanation would involve walking the code through a few examples (aka "running it by hand") and pointing out corner cases, explaining the time and space complexity, and even talking about possible alternative approaches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment