Question

There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to…

Question

Example 1:

Input: s = "A man, a plan, a canal: Panama"
Output: true
Explanation: "amanaplanacanalpanama" is a palindrome.

Example 2:

Input: s = "race a car"
Output: false
Explanation: "raceacar" is not a palindrome…

Question

You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.

Return the maximum profit…

Question

In Pascal’s triangle, each number is the sum of the two numbers directly above it as shown:

Example 1:

Input: numRows = 5
Output: [,[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]

Example 2:

Input: numRows = 1
Output: []

LeetCode Algorithm Challenges: Single Number

Question: Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.

You must implement a solution with a linear runtime complexity and use only constant extra space.

Example 1:

Input: nums = [2,2,1]
Output: 1

Example 2:

Input: nums = [4,1,2,1,2]
Output…

Question

A height-balanced binary tree is a binary tree in which the depth of the two subtrees of every node never differs by more than one.

Example 1:

Input: nums…

LeetCode Algorithm Challenges: Minimum & Maximum Depth of Binary Tree

Today I’ll cover 2 questions because they look pretty similar to me even though looking for opposite results. But the solution will have something in common.

Question 1

A binary tree’s maximum depth is the number of nodes along the longest… Nick Solonyy

Full-stack software engineer with an international MBA. Project Management and Team Collaboration experience. React | Javascript | Redux | Rails