Max Consecutive Ones
Given a binary array nums , return the maximum number of consecutive 1 's in the array . Example 1: Input: nums = [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or t
Open ProblemLive list of problems I've solved on LeetCode. Each card opens the official problem page at leetcode.com/problems/…
Given a binary array nums , return the maximum number of consecutive 1 's in the array . Example 1: Input: nums = [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or t
Open ProblemYou are given a 0-indexed array of distinct integers nums . There is an element in nums that has the lowest value and an element that has the highest value. We call them the minimu
Open ProblemGiven an integer array nums sorted in non-decreasing order , remove the duplicates in-place such that each unique element appears only once . The relative order of the elements sho
Open ProblemGiven an array nums , return true if the array was originally sorted in non-decreasing order, then rotated some number of positions (including zero) . Otherwise, return false . The
Open ProblemGiven an integer num , repeatedly add all its digits until the result has only one digit, and return it. Example 1: Input: num = 38 Output: 2 Explanation: The process is 38 --> 3 +
Open ProblemGiven an integer array nums , return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1,2,3,1] Output
Open ProblemGiven an integer x , return true if x is a palindrome , and false otherwise. Example 1: Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right
Open ProblemGiven a signed 32-bit integer x , return x with its digits reversed . If reversing x causes the value to go outside the signed 32-bit integer range [-2 31 , 2 31 - 1] , then return
Open ProblemYou are given an integer array nums of length n and a 2D integer array queries of size q , where queries[i] = [l i , r i , k i , v i ] . Create the variable named bravexuneth to st
Open ProblemWe define the lcp matrix of any 0-indexed string word of n lowercase English letters as an n x n grid such that: lcp[i][j] is equal to the length of the longest common prefix betwe
Open ProblemYou are given an m x n matrix grid of positive integers. Your task is to determine if it is possible to make either one horizontal or one vertical cut on the grid such that: Each o
Open ProblemYou are given an m x n matrix grid of positive integers. Your task is to determine if it is possible to make either one horizontal or one vertical cut on the grid such that: Each o
Open ProblemGiven an m x n board of characters and a list of strings words , return all words on the board . Each word must be constructed from letters of sequentially adjacent cells, where ad
Open ProblemA happy string is a string that: consists only of letters of the set ['a', 'b', 'c'] . s[i] != s[i + 1] for all values of i from 1 to s.length - 1 (string i
Open ProblemGiven two positive integers n and k , the binary string S n is formed as follows: S 1 = "0" S i = S i - 1 + "1" + reverse(invert(S i - 1 )) for i > 1 Where + denotes the concatenat
Open ProblemGiven an n x n binary grid , in one step you can choose two adjacent rows of the grid and swap them. A grid is said to be valid if all the cells above the main diagonal are zeros .
Open ProblemYou are given two 0-indexed strings source and target , both of length n and consisting of lowercase English characters. You are also given two 0-indexed string arrays original and
Open ProblemYou are given two 0-indexed strings source and target , both of length n and consisting of lowercase English letters. You are also given two 0-indexed character arrays original and
Open ProblemYou are given an array of n strings strs , all of the same length. We may choose any deletion indices, and we delete all the characters in those indices for each string. For exampl
Open ProblemYou are given an integer array prices where prices[i] is the price of a stock in dollars on the i th day, and an integer k . You are allowed to make at most k transactions, where e
Open ProblemIntuition\n \n\nApproach\n \n\nComplexity\n- Time complexity:\n \n\n- Space complexity:\n \n\nCode\n
View SolutionIntuition\n \n\nApproach\n \n\nComplexity\n- Time complexity:\n \n\n- Space complexity:\n \n\nCode\n
View SolutionIntuition\n \n\nApproach\n \n\nComplexity\n- Time complexity:\n \n\n- Space complexity:\n \n\nCode\n
View Solution