LeetCode 236 - Lowest Common Ancestor of a Binary Tree
Table of Contents Problem Statement Using Tree DFS (Depth First Search) Conclusion Problem Statement Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tr...
Table of Contents Problem Statement Using Tree DFS (Depth First Search) Conclusion Problem Statement Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tr...
Table of Contents Problem Statement Using Dynamic Programming Conclusion Problem Statement On day 1, one person discovers a secret. You are given an integer delay, which means that each p...
Table of Contents Problem Statement Using Two Stacks Conclusion Problem Statement Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the en...
Table of Contents Problem Statement Using Two Stacks Conclusion Problem Statement Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support al...
Table of Contents Problem Statement Using In-place Conclusion Problem Statement Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0’s. You must do ...
Table of Contents Problem Statement Using Two Pointers Conclusion Problem Statement You are given the head of a singly linked-list. The list can be represented as: L0 → L1 → … → Ln - 1 → ...
Table of Contents Problem Statement Using Two Pointers Conclusion Problem Statement Given the head of a singly linked list, return true if it is a palindrome or false otherwise. Using Two...
Table of Contents Problem Statement Using Two Pointers Conclusion Problem Statement Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space c...
Table of Contents Problem Statement Using Sliding Window Conclusion Problem Statement Given two strings s and p, return an array of all the start indices of p’s anagrams in s. You may retu...
Table of Contents Problem Statement Using Finite State Machine (FSM) Conclusion Problem Statement Implement the myAtoi(string s) function, which converts a string to a 32-bit signed intege...