1530. Number of Good Leaf Nodes Pairs
You are given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is […]
You are given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is […]
You are given an array arr. Your task is to find the longest length of a good sequence. A good sequence {x1, x2, .. xn}
Given the root of a binary tree, each node in the tree has a distinct value. After deleting all nodes with a
Given an array parent that is used to represent a tree. The array indices (0-based indexing) are the values of the tree
You are given the root of a binary tree with n nodes. Each node is uniquely assigned a value from 1 to n. You are also given an integer startValue representing
Given a string s without spaces, a character ch and an integer count. Your task is to return the substring that remains after the character ch has appeared count number
You are given a 2D integer array descriptions where descriptions[i] = [parenti, childi, isLefti] indicates that parenti is the parent of childi in a binary tree of unique values. Furthermore, If isLefti == 1, then childi is
Given two integers s and d. The task is to find the smallest number such that the sum of its digits is s and the
Given a string formula representing a chemical formula, return the count of each atom. The atomic element always starts with an uppercase character,
Given an array arr consisting of only 0‘s and 1‘s in random order. Modify the array in-place to segregate 0s onto the left side and 1s
You are given a weighted undirected graph having n vertices numbered from 1 to n and m edges along with their weights. Find the shortest path between the
There are n 1-indexed robots, each having a position on a line, health, and movement direction. You are given 0-indexed integer arrays positions, healths, and a string directions (directions[i] is