Link to problem Problem Given two integer arrays inorder and postorder where inorder is the inorder traversal of a binary tree and postorder is the postorder traversal of the same tree, construct...
Leetcode 145 - Binary Tree Postorder Traversal
Link to problem Problem Given the root of a binary tree, return the postorder traversal of its nodes’ values. Solution Simple post order traversal problem. Could be solved with trivial recursiv...
Leetcode 946 - Validate Stack Sequence
Link to problem Problem Given two integer arrays pushed and popped each with distinct values, return true if this could have been the result of a sequence of push and pop operations on an initial...
Leetcode 39 - Combination Sum
Link to problem Problem Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. ...
Leetcode 1026 - Maximum Difference Between Node and Ancestor
Link to problem Problem Given the root of a binary tree, find the maximum value v for which there exist different nodes a and b where v = |a.val - b.val| and a is an ancestor of b. A node a is a...
Leetcode 2092 - Find All People With Secret
Link to problem Problem You are given an integer n indicating there are n people numbered from 0 to n - 1. You are also given a 0-indexed 2D integer array meetings where meetings[i] = [x_i, y_i, ...
Leetcode 1937 - Maximum Number of Points with Cost
Link to problem Problem You are given an m x n integer matrix points (0-indexed). Starting with 0 points, you want to maximize the number of points you can get from the matrix. To gain points, y...
Leetcode 1367 - Linked List in Binary Tree
Link to problem Problem Given a binary tree rootand a linked list with head as the first node. Return True if all the elements in the linked list starting from the head correspond to some downwa...
Leetcode 1451 - Rearrange Words in a Sentence
Link to problem Problem Given a sentence text (A sentence is a string of space-separated words) in the following format: First letter is in upper case. Each word in text are separated by a ...
Leetcode 376 - Wiggle Subsequence
Link to problem Problem A wiggle sequence is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may...