3151. Special Array I
Problem An array is considered special if every pair of its adjacent elements contains two numbers with different parity. You...
Problem An array is considered special if every pair of its adjacent elements contains two numbers with different parity. You...
Problem You are given coordinates, a string that represents the coordinates of a square of the chessboard. Below is a chessbo...
Problem You are given an 8 x 8 matrix representing a chessboard. There is exactly one white rook represented by 'R', some num...
Problem You are given two strings, coordinate1 and coordinate2, representing the coordinates of a square on an 8 x 8 chessboa...
Problem Given a sentence that consists of some words separated by a single space, and a searchWord, check if searchWord is a ...
Problem Given an array arr of integers, check if there exist two indices i and j such that : i != j 0 <= i, j < arr.le...
Problem You are given an array of positive integers nums. Alice and Bob are playing a game. In the game, Alice can choose eit...
Problem Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s. A shift ...
Problem A sentence is a list of words that are separated by a single space with no leading or trailing spaces. For example, ...
Problem A fancy string is a string where no three consecutive characters are equal. Given a string s, delete the minimum poss...
Problem You are given two positive integers x and y, denoting the number of coins with values 75 and 10 respectively. Alice a...
Problem You are given two positive integers n and k. You can choose any bit in the binary representation of n that is equal t...
Problem There are n teams numbered from 0 to n - 1 in a tournament. Given a 0-indexed 2D boolean matrix grid of size n * n. F...
Problem A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alpha...
Problem There is a circle of red and blue tiles. You are given an array of integers colors. The color of tile i is represente...
Problem You are given an array prices where prices[i] is the price of a given stock on the iᵗʰ day. You want to maximize your...
Problem Given two strings s and t, return true if t is an anagram of s, and false otherwise. An anagram is a word or phrase ...
Problem Given the root of a binary tree, return its maximum depth. A binary tree’s maximum depth is the number of nodes along...
Problem Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees ...
Problem Given the root of a binary tree, invert the tree, and return its root. https://leetcode.com/problems/invert-binary-tr...
Problem Given an integer array nums, return true if any value appears at least twice in the array, and return false if every ...
Problem You are given an integer n representing the number of players in a game and a 2D array pick where pick[i] = [xᵢ, yᵢ] ...
Problem Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the numbe...
Problem Given the head of a singly linked list, reverse the list, and return the reversed list. https://leetcode.com/problems...
Problem There is a snake in an n x n matrix grid and can move in four possible directions. Each cell in the grid is identifie...
Problem You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how ...
Problem Given a positive integer n, write a function that returns the number of set bits in its binary representation (also k...
Problem Reverse bits of a given 32 bits unsigned integer. Note: Note that in some languages, such as Java, there is no unsig...
Problem Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structu...
Problem An image smoother is a filter of the size 3 x 3 that can be applied to each cell of an image by rounding down the ave...
Problem You are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The lis...
Problem Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input str...