The next problem is a great example of problems that may be solved by recursion or by DP. Excellent to study for your SW interview
You are climbing a staircase. It takes
n steps to reach the top.
Each time you can either climb
2 steps. In…
The next exercise will help you landing that software interview by using DP.
Problem #62. Unique Paths
A robot is located at the top-left corner of a
m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at any point in…
The next exercise will help you landing that Software interview. Extracted from leetcode: https://leetcode.com/problems/decode-ways/
A message containing letters from
A-Z can be encoded into numbers using the following mapping:
'A' -> "1"
'B' -> "2"
'Z' -> "26"
To decode an encoded message, all the digits must be grouped…
The following leetcode excercise will help you to practice using strings and stacks. https://leetcode.com/problems/valid-parentheses/
Problem #20. Valid Parentheses
Given a string
s containing just the characters
']', determine if the input string is valid.
An input string is valid if:
The following problem helps you to manage data structures and string manipulation
Problem #71. Simplify Path
Given a string
path, which is an absolute path (starting with a slash
'/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path.
The following leetcode exercise asks the user to implement a min stack. Link: https://leetcode.com/problems/min-stack
Problem #155. Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
MinStack()initializes the stack object.
void push(val)pushes the element
The next medium level leetcode exercise provides a good understanding of search algorithms and array operations. Exercise: https://leetcode.com/problems/search-in-rotated-sorted-array/
Problem #33. Search in Rotated Sorted Array
There is an integer array
nums sorted in ascending order (with distinct values).
Prior to being passed to your function,
nums is rotated at an…
The next writting will contain my solution for the following leetcode problems: https://leetcode.com/problems/reverse-linked-list/ and https://leetcode.com/problems/rotate-list/
These two are fairly simple linked list problems. to handle these type of problem is usually recommended to use a dummy node prev that points your current element.
Problem # 206. Reverse Linked List
From Leetcode excersice https://leetcode.com/problems/projection-area-of-3d-shapes/
We are solving this problem that covers arrays management and a little bit of mathematics and spatial intelligence.
You are given an
n x n
grid where we place some
1 x 1 x 1 cubes that are axis-aligned with the
This is a popurri with good practices excercises for SW interviews
709. To Lower Case
Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.