This contains leetcode problems as Python stubs.
To run in Visual Studio Code, simply open the problem page in the editor and press F5 to start debugging. It will automatically run the automated tests.
The are three categories of difficulty in Leetcode. This list attempts to show questions in order of difficulty. (Some of these questions a trivial one-liners in Python but require significant knowledge in lower-level languages)
- Power of Two: ANother integer division problem
- Power of Three: Very simple example of integer division and modulus
- Power of Four: Can be done cleger
- Ugly Number: Simple example of integer division and modulus
- Number of Steps to Reduce a Number to Zero: Like the project Euler question 3 - just a while loop
- Count of Operations To Obtain Zero: Similar to GCD problem
- Fibonacci Number: Basic Fibonacci problem
Just going by the array tag
- Concatenation of Array: A simple one liner
- Sum of 1d Array: Creating a new array as an accumulation of an existing array
- Best Time to Buy and Sell Stock II:m Not really a dynamic programming problem. You are simply adding all of the positive differences
- Shuffle the Array: Interpolate two arrays
- Kids with the Greatest Number of Candies: Simple once you understand the problem. Involves the
maxfunction and converting a list into a list of bools - Decompress Run-Length Encoded List: Understanding the problem is hard until you read the example.
- Reverse String: In-place rearranging (reversal) of an array
- Remove Duplicates from Sorted Array: In-place rearranging of the elements in an array
- Move Zeros: In-place rearranging of the elements in an array
- Word Pattern: Maintaining and looking up two hash tables
- First Bad Version: Probably the easiest binary search problem you can have
- Range Sum Query - Immutable: Setting a value in the
__init__method, then querying it in a different method
- HackerRank
- CodeWars - Harder questions than leetcode