Given an array of integers and a target value, return the indices of 2 numbers that add up to the input target value. The first “two sum” in our example is 8 and 2, because they add up to 10. LeetCode also asks us to return the indices which are…
Design HashMap LeetCode Interview Question (Explained Simply)
Hash maps are used to store data in key-value pairs. They are similar to arrays because arrays values are stored against numeric keys known as indexes. Hash maps allow us to have flexible keys. The upside to hash maps is that they have lighting fast searches and insertions. The downside…
Missing Number LeetCode Question (Explained Simply)
Given an array of numbers, that are all distinct, return the only number in the range that is missing. This question wants you to find the missing number in sequence of arrays, example: In the example above, the number we want to find is 5. Steps
Move Zeroes LeetCode Interview Question (Explained Simply)
The title of this LeetCode questions is very ambiguous and does not do a great job explaining what it actually does. All this interview question is asking you to do is move the zeros to the end of an array. That’s it. Before: After: 2-Pointer Step-By-Step (In-Place)
Valid Mountain Array in Java (Explained Simply)
Essentially, this Leetcode question is asking “do the numbers in an array go up then go down“. It’s called a mountain array because if you draw a line tracing the path of the numbers it will look something like this: The following conditions must apply: Another way to describe this…