Balanced Binary Tree
Determine if a given binary tree is height-balanced, meaning the heights of the two subtrees of every node never differ by more than one.
Determine if a given binary tree is height-balanced, meaning the heights of the two subtrees of every node never differ by more than one.
Given the root of a binary tree, return the values of its nodes level by level, from left to right.
You need to find the number of distinct ways to climb a staircase with `n` steps, given that you can take either 1 or 2 steps at a time.
Given a 2D grid representing an image, a starting pixel's coordinates, and a new color, change the color of the starting pixel and all…
Given the root of a binary tree, invert the tree by swapping its left and right children at each node.
Find all possible arrangements of distinct integers in an array.
Given the head of a singly linked list, reverse the list and return the head of the reversed list.
Determine if a given binary tree is a valid binary search tree (BST).