Given an integer numRows, return the first numRows of Pascal’s triangle. In Pascal’s triangle, each number is the sum of the two numbers…
Coding
LeetCode Path Sum Solution
Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values…
LeetCode Minimum Depth of Binary Tree Solution
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path…
LeetCode Balanced Binary Tree Solution
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a…
LeetCode Convert Sorted Array to Binary Search Tree Solution
Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree. A height-balanced binary tree is a binary…