515 Find Largest Value In Each Tree Row
Find Largest Value in Each Tree Row Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed). Example 1: **Input:** root = [1,3,2,5,3,null,...
Find Largest Value in Each Tree Row Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed). Example 1: **Input:** root = [1,3,2,5,3,null,...
Find Minimum Diameter After Merging Two Trees There exist two **undirected **trees with n and m nodes, numbered from 0 to n - 1 and from 0 to m - 1, respectively. You are given two 2D integer arr...
Minimum Number of Operations to Sort a Binary Tree by Level You are given the root of a binary tree with unique values. In one operation, you can choose any two nodes at the same level and swap ...
Find Building Where Alice and Bob Can Meet You are given a 0-indexed array heights of positive integers, where heights[i] represents the height of the ith building. If a person is in building i,...
Maximum Number of K-Divisible Components There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i]...
Reverse Odd Levels of Binary Tree Given the root of a perfect binary tree, reverse the node values at each odd level of the tree. For example, suppose the node values at level 3 are [2,1,3,4,7,1...
Max Chunks To Make Sorted You are given an integer array arr of length n that represents a permutation of the integers in the range [0, n - 1]. We split arr into some number of chunks (i.e., par...
Final Prices With a Special Discount in a Shop You are given an integer array prices where prices[i] is the price of the ith item in a shop. There is a special discount for items in the shop. If...
Construct String With Repeat Limit You are given a string s and an integer repeatLimit. Construct a new string repeatLimitedString using the characters of s such that no letter appears more than ...
Final Array State After K Multiplication Operations I You are given an integer array nums, an integer k, and an integer multiplier. You need to perform k operations on nums. In each operation: ...