Leetcode 0463. Island Perimeter
You are given `row x col` `grid` representing a map where `grid[i][j] = 1` represents land and `grid[i][j] = 0` represents water. Grid cells are connected horizontally/vertically (not dia...
You are given `row x col` `grid` representing a map where `grid[i][j] = 1` represents land and `grid[i][j] = 0` represents water. Grid cells are connected horizontally/vertically (not dia...
Given the `root` of a binary tree and an integer `targetSum`, return `true` if the tree has a root-to-leaf path such that adding up all the values along the path equals `targetSum`. A **l...
You are given the `root` of a binary search tree (BST) and an integer `val`. Find the node in the BST that the node's value equals `val` and return the subtree rooted with that node. If s...
Given an integer array `nums` where the elements are sorted in `ascending order`, convert _it to a height-balanced binary search tree. A height-balanced binary tree is a binary tree in wh...
Given the `root` of a binary tree, return the postorder traversal of its nodes' values. Example 1: Input: root = [1,null,2,3], Output: [1,3,2] Example 2: Input: root = ...
Given the `root` of a binary tree, return the preorder traversal of its nodes' values. Example 1: Input: root = [1,null,2,3], Output: [1,3,2] Example 2: Input: root = [...
Given the `root` of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Example 1: Input: root = [1,2,2,3,4,4,3], Output: true Example ...
Given the `root` of a binary tree, return the inorder traversal of its nodes' values. Example 1: Input: root = [1,null,2,3], Output: [1,3,2] Example 2: Input: root = []...
Given an array of integers `nums` which is sorted in ascending order, and an integer `target`, write a function to search `target` in `nums`. If `target` exists, then return its index. Otherwi...
The Fibonacci numbers, commonly denoted `F(n)` form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from `0` and `1`. That is, ...