Skip to main content
LeetCode · @coderknk

My LeetCode Questions

Live list of problems I've solved on LeetCode. Each card opens the official problem page at leetcode.com/problems/…

24 Jul 2026Problem LeetCode

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

LeetCodeEasyArray
Open Problem
21 Jul 2026Problem LeetCode

Removing Minimum and Maximum From Array

You 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

LeetCodeMediumArrayGreedy
Open Problem
20 Jul 2026Problem LeetCode

Remove Duplicates from Sorted Array

Given 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

LeetCodeEasyArrayTwo Pointers
Open Problem
19 Jul 2026Problem LeetCode

Check if Array Is Sorted and Rotated

Given 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

LeetCodeEasyArray
Open Problem
19 Jul 2026Problem LeetCode

Add Digits

Given 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 +

LeetCodeEasyMathSimulation
Open Problem
14 Jul 2026Problem LeetCode

Contains Duplicate

Given 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

LeetCodeEasyArrayHash Table
Open Problem
7 Jul 2026Problem LeetCode

Palindrome Number

Given 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

LeetCodeEasyMath
Open Problem
7 Jul 2026Problem LeetCode

Reverse Integer

Given 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

LeetCodeMediumMath
Open Problem
9 Apr 2026Problem LeetCode

XOR After Range Multiplication Queries II

You 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

LeetCodeHardArrayDivide and Conquer
Open Problem
28 Mar 2026Problem LeetCode

Find the String with LCP

We 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

LeetCodeHardArrayString
Open Problem
26 Mar 2026Problem LeetCode

Equal Sum Grid Partition II

You 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

LeetCodeHardArrayHash Table
Open Problem
25 Mar 2026Problem LeetCode

Equal Sum Grid Partition I

You 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

LeetCodeMediumArrayMatrix
Open Problem
14 Mar 2026Problem LeetCode

Word Search II

Given 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

LeetCodeHardArrayString
Open Problem
14 Mar 2026Problem LeetCode

The k-th Lexicographical String of All Happy Strings of Length n

A 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

LeetCodeMediumStringBacktracking
Open Problem
4 Mar 2026Problem LeetCode

Find Kth Bit in Nth Binary String

Given 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

LeetCodeMediumStringRecursion
Open Problem
2 Mar 2026Problem LeetCode

Minimum Swaps to Arrange a Binary Grid

Given 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 .

LeetCodeMediumArrayGreedy
Open Problem
30 Jan 2026Problem LeetCode

Minimum Cost to Convert String II

You 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

LeetCodeHardArrayString
Open Problem
29 Jan 2026Problem LeetCode

Minimum Cost to Convert String I

You 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

LeetCodeMediumArrayString
Open Problem
22 Dec 2025Problem LeetCode

Delete Columns to Make Sorted III

You 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

LeetCodeHardArrayString
Open Problem
17 Dec 2025Problem LeetCode

Best Time to Buy and Sell Stock V

You 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

LeetCodeMediumArrayDynamic Programming
Open Problem
8 Sept 2024Solution LeetCode

Convert 1D Array Into 2D Array

Intuition\n \n\nApproach\n \n\nComplexity\n- Time complexity:\n \n\n- Space complexity:\n \n\nCode\n

LeetCodeEasyArrayMatrix
View Solution
7 Jun 2024Solution LeetCode

Reverse String

Intuition\n \n\nApproach\n \n\nComplexity\n- Time complexity:\n \n\n- Space complexity:\n \n\nCode\n

LeetCodeEasyTwo PointersString
View Solution
27 Feb 2024Solution LeetCode

Copy List with Random Pointer

Intuition\n \n\nApproach\n \n\nComplexity\n- Time complexity:\n \n\n- Space complexity:\n \n\nCode\n

LeetCodeMediumHash TableLinked List
View Solution