99. Recover Binary Search Tree
99. Recover Binary Search Tree
Description
You are given the root
of a binary search tree (BST), where the values of exactly two nodes of the tree were swapped by mistake. Recover the tree without changing its structure.
3213. Construct String with Minimum Cost
3213. Construct String with Minimum Cost
Description
You are given a string target
, an array of strings words
, and an integer array costs
, both arrays of the same length.
3212. Count Submatrices With Equal Frequency of X and Y
3212. Count Submatrices With Equal Frequency of X and Y
Description
Given a 2D character matrix grid
, where grid[i][j]
is either 'X'
, 'Y'
, or '.'
, return the number of submatrices that contain:
3211. Generate Binary Strings Without Adjacent Zeros
3210. Find the Encrypted String
3210. Find the Encrypted String
Description
You are given a string s
and an integer k
. Encrypt the string using the following algorithm:
536. Construct Binary Tree from String
536. Construct Binary Tree from String
Description
You need to construct a binary tree from a string consisting of parenthesis and integers.
582. Kill Process
742. Closest Leaf in a Binary Tree
742. Closest Leaf in a Binary Tree
Description
Given the root
of a binary tree where every node has a unique value and a target integer k
, return the value of the nearest leaf node to the target k
in the tree.
3209. Number of Subarrays With AND Value of K
3209. Number of Subarrays With AND Value of K
Description
Given an array of integers nums
and an integer k
, return the number of subarrays of nums
where the bitwise AND
of the elements of the subarray equals k
.