1261. Find Elements in a Contaminated Binary Tree
Given a binary tree with the following rules: root.val == 0 For any treeNode: If treeNode.val has a value x and treeNode.left != null, then treeNode.left.val == […]
Given a binary tree with the following rules: root.val == 0 For any treeNode: If treeNode.val has a value x and treeNode.left != null, then treeNode.left.val == […]
Given an array of points where each point is represented as points[i] = [xi, yi] on the X-Y plane and an integer k,
You are given a 0-indexed string pattern of length n consisting of the characters ‘I’ meaning increasing and ‘D’ meaning decreasing. A 0-indexed string num of length n + 1 is created using the following conditions: num consists of the
Serialization is to store a tree in an array so that it can be later restored and deserialization is reading
Given an integer n, find a sequence that satisfies all of the following: The integer 1 occurs once in the sequence. Each integer
Given a Binary Search Tree (with all values unique) and two nodes n1 and n2 (n1 != n2). You may assume that both nodes exist
Given a positive integer n, return the punishment number of n. The punishment number of n is defined as the sum of the squares of all integers i such that: 1
Design an algorithm that accepts a stream of integers and retrieves the product of the last k integers of the stream. Implement
Given the root of a Binary search tree(BST), where exactly two nodes were swapped by mistake. Your task is to fix (or correct) the
You are given a 0-indexed integer array nums, and an integer k. In one operation, you will: Take the two smallest integers x and y in nums. Remove x and y from nums. Add min(x,
Given a Binary Search Tree(BST) and a target. Check whether there’s a pair of Nodes in the BST with value summing
You are given a 0-indexed array nums consisting of positive integers. You can choose two indices i and j, such that i != j, and the sum of digits of