In this post I will discuss the solution to the leetcode problem — Binary Tree Inorder Traversal.

Given the `root`

of a binary tree, return the inorder traversal of its nodes' values.

**Example 1:**

**Input:** root = [1,null,2,3]

**Output:** [1,3,2]

**Example 2:**

**Input:** root = []

**Output:** []

**Example 3:**

**Input:** root = [1]

**Output:** [1]

**Example 4:**

In this post I will discuss the solution to the leetcode problem — Remove Duplicates from Sorted List.

Given the `head`

of a sorted linked list, *delete all duplicates such that each element appears only once*. Return *the linked list **sorted** as well*.

**Example 1:**

**Input:** head = [1,1,2]

**Output:** [1,2]

**Example 2:**

In this post I will discuss the solution to the leetcode problem — Climbing Stairs.

You are climbing a staircase. It takes `n`

steps to reach the top.

Each time you can either climb `1`

or `2`

steps. In how many distinct ways can you climb to the top?

**Example 1:**

**Input:** n = 2

**Output:** 2

**Explanation:** There are two ways to climb to the top.

1. 1 step + 1 step

2. 2 steps

**Example 2:**

**Input:** n = 3

**Output:** 3

**Explanation:** There are three ways to climb to the top.

1. 1 step + 1 step + 1 step

2…

In this post I will discuss the solution to the leetcode problem —Plus One.

Given a **non-empty** array of decimal digits representing a non-negative integer, increment one to the integer.

The digits are stored such that the most significant digit is at the head of the list, and each element in the array contains a single digit.

You may assume the integer does not contain any leading zero, except the number 0 itself.

**Example 1:**

**Input:** digits = [1,2,3]

**Output:** [1,2,4]

**Explanation:** The array represents the integer 123.

**Example 2:**

**Input:** digits = [4,3,2,1]

**Output:** [4,3,2,2]

**Explanation:** The array represents the integer…

In this post I will discuss the solution to the leetcode problem — Length of Last Word.

Given a string `s`

consists of some words separated by spaces, return *the length of the last word in the string. If the last word does not exist, return *`0`

.

A **word** is a maximal substring consisting of non-space characters only.

**Example 1:**

**Input:** s = "Hello World"

**Output:** 5

**Example 2:**

**Input:** s = " "

**Output:** 0

**Constraints:**

`1 <= s.length <= 104`

`s`

consists of only English letters and spaces`' '`

.

This is one of the simplest leetcode problems…

In this post I will discuss the solution to the leetcode problem — Remove Element

Given an array *nums* and a value `val`

, remove all instances of that value **in-place** and return the new length.

Do not allocate extra space for another array, you must do this by **modifying the input array ****in-place** with `O(1)`

extra memory.

The order of elements can be changed. It doesn’t matter what you leave beyond the new length.

**Clarification:**

Confused why the returned value is an integer but your answer is an array?

Note that the input array is passed in by **reference**, which…

In this post I will discuss the solution to the leetcode problem — Remove Duplicates from Sorted Array

Given a sorted array *nums*, remove the duplicates **in-place** such that each element appears only *once* and returns the new length.

Do not allocate extra space for another array, you must do this by **modifying the input array ****in-place** with O(1) extra memory.

**Clarification:**

Confused why the returned value is an integer but your answer is an array?

Note that the input array is passed in by **reference**, which means a modification to the input array will be known to the caller…

In this post I will discuss the solution to the leetcode problem — Merge Two Sorted Lists.

Merge two sorted linked lists and return it as a **sorted** list. The list should be made by splicing together the nodes of the first two lists.

**Example 1:**

**Input:** l1 = [1,2,4], l2 = [1,3,4]

**Output:** [1,1,2,3,4,4]

**Example 2:**

**Input:** l1 = [], l2 = []

**Output:** []

**Example 3:**

**Input:** l1 = [], l2 = [0]

**Output:** [0]

**Constraints:**

- The number of nodes in both lists is in the range
`[0, 50]`

. `-100 <= Node.val <= 100`

- Both
`l1`

and`l2`

…

In this post I will discuss the solution to the leetcode problem — Valid Parentheses.

Given a string `s`

containing just the characters `'('`

, `')'`

, `'{'`

, `'}'`

, `'['`

and `']'`

, determine if the input string is valid.

An input string is valid if:

- Open brackets must be closed by the same type of brackets.
- Open brackets must be closed in the correct order.

**Example 1:**

`Input`**:** s = "()"

Output**:** true

**Example 2:**

`Input`**:** s = "()[]{}"

Output**:** true

**Example 3:**

`Input`**:** s = "(]"

Output: false

**Example 4:**

`Input: s = "([)]"`

Output: false

**Example 5:**

`Input: s =…`

In this post I will discuss the solution to the leetcode problem — Longest Common Prefix.

Write a function to find the longest common prefix string amongst an array of strings.

If there is no common prefix, return an empty string `""`

.

**Example 1:**

**Input:** strs = ["flower","flow","flight"]

**Output:** "fl"

**Example 2:**

**Input:** strs = ["dog","racecar","car"]

**Output:** ""

**Explanation:** There is no common prefix among the input strings.

**Constraints:**

`0 <= strs.length <= 200`

`0 <= strs[i].length <= 200`

`strs[i]`

consists of only lower-case English letters.

The algorithm is as follows —

- If the input array of strings is empty…