1894. Find the Student that Will Replace the Chalk
There are n students in a class numbered from 0 to n – 1. The teacher will give each student a problem starting with the […]
There are n students in a class numbered from 0 to n – 1. The teacher will give each student a problem starting with the […]
Given a square grid of size N, each cell of which contains an integer cost that represents a cost to traverse through that
You are given a 0-indexed 1-dimensional (1D) integer array original, and two integers, m and n. You are tasked with creating a 2-dimensional (2D) array with
Given two sorted arrays of distinct integers arr1 and arr2. Each array may have some elements in common with the other array. Find the maximum sum of a
Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary
You are given an array arr, you need to find any three elements in it such that arr[i] < arr[j] <
You are given an undirected weighted connected graph containing n nodes labeled from 0 to n – 1, and an integer array edges where edges[i] = [ai, bi, wi] indicates that there
The n-queens puzzle is the problem of placing n queens on a (n×n) chessboard such that no two queens can attack each other.Given an integer n,
On a 2D plane, we place n stones at some integer coordinate points. Each coordinate point may have at most one stone.
Given the head of a linked list, determine whether the list contains a loop. If a loop is present, return the
You are given two m x n binary matrices grid1 and grid2 containing only 0‘s (representing water) and 1‘s (representing land). An island is a group of 1‘s connected 4-directionally (horizontal or vertical).
Given an array of integers arr, sort the array according to the frequency of elements, i.e. elements that have higher frequency comes first. If the