Easy Problems
706 problems
This track helps you build stable solving and explanation quality at this pressure level.
Training Focus
Stabilize fundamentals and explanation rhythm.
Cadence
Run 3-5 problems per round: explain, implement, then review failure paths.
Pair With
Pair this track with topic and pattern pages for faster transfer learning.
Two Sum
Two Sum is solved fastest by storing seen values in a hash map and checking each number's needed complement once.
Palindrome Number
Determine if a given integer reads the same forward and backward using a math-driven solution strategy without convertin…
Roman to Integer
Convert a Roman numeral string into an integer using a hash table and mathematical principles to determine value order.
Longest Common Prefix
Find the longest common prefix in an array of strings, returning an empty string if none exists.
Valid Parentheses
Determine if a string of parentheses, brackets, and braces is correctly nested using a stack for proper order validation…
Merge Two Sorted Lists
Merge two sorted linked lists by splicing nodes into one sorted list using linked-list pointer manipulation and recursio…
Remove Duplicates from Sorted Array
Learn how to remove duplicates from a sorted array in-place using two-pointer scanning while preserving element order.
Remove Element
Remove Element challenges you to remove a value from an array in-place using efficient two-pointer scanning and tracking…
Find the Index of the First Occurrence in a String
Locate the first occurrence of a substring within a string using a two-pointer scanning strategy and invariant tracking …
Search Insert Position
Find the correct index for a target value in a sorted array using binary search, or return the position where it should …
Length of Last Word
Determine the length of the last word in a string using a focused string-driven approach to handle spaces and trailing c…
Plus One
Given a number as an array of digits, increment it by one and return the updated array of digits.
Add Binary
Add Binary involves summing two binary strings and returning the result as a binary string using math and string manipul…
Sqrt(x)
Solve the Sqrt(x) problem using binary search to find the integer square root of a number without built-in operators.
Climbing Stairs
Climbing Stairs is a classic dynamic programming problem where you calculate distinct ways to reach the top using step t…
Remove Duplicates from Sorted List
Efficiently remove duplicates from a sorted linked list using precise pointer manipulation while maintaining node order …
Merge Sorted Array
Merge two sorted arrays into the first array in non-decreasing order, using a two-pointer approach.
Binary Tree Inorder Traversal
Binary Tree Inorder Traversal asks you to visit left subtree, node, then right subtree without losing position while mov…
Same Tree
Check whether two binary trees are identical by comparing structure and node values using DFS or BFS traversal strategie…
Symmetric Tree
Determine if a binary tree is symmetric by comparing left and right subtrees using DFS or BFS traversal techniques effic…
Maximum Depth of Binary Tree
Find the maximum depth of a binary tree using traversal techniques to track the longest path from root to leaf.
Convert Sorted Array to Binary Search Tree
Pick the middle element as root at each step so the sorted array becomes a height-balanced BST with valid ordering.
Balanced Binary Tree
Determine if a binary tree is height-balanced using tree traversal and state tracking techniques.
Minimum Depth of Binary Tree
Find the minimum depth of a binary tree, which is the shortest path from the root node to the nearest leaf node.
Path Sum
Determine if a binary tree has a root-to-leaf path where the sum of node values equals a given target sum, using DFS or …
Pascal's Triangle
Generate the first numRows of Pascal's Triangle using dynamic programming with clear state transitions and array manipul…
Pascal's Triangle II
Compute the specific row of Pascal's Triangle using efficient state transition dynamic programming with array-based upda…
Best Time to Buy and Sell Stock
Maximize stock profit by identifying the optimal buy and sell days using dynamic programming.
Valid Palindrome
Check if a given string is a valid palindrome by using two-pointer scanning and invariant tracking techniques.
Single Number
Solve the Single Number problem using an efficient approach with constant space and linear time complexity.
Linked List Cycle
Determine if a given linked list contains a cycle using pointer manipulation or hashing, focusing on detecting repeated …
Binary Tree Preorder Traversal
Perform a binary tree preorder traversal by visiting root nodes first, then left and right subtrees, tracking state iter…
Binary Tree Postorder Traversal
Solve Binary Tree Postorder Traversal using state tracking and binary-tree traversal techniques, focusing on Stack, Tree…
Intersection of Two Linked Lists
Given two linked lists, find the node where they intersect or return null if they do not.
Excel Sheet Column Title
Convert a positive integer to its corresponding Excel column title using base-26 math and string manipulation efficientl…
Majority Element
Find the majority element in an array, where the element appears more than n/2 times, using efficient algorithms.
Excel Sheet Column Number
This problem requires converting an Excel column title into its corresponding column number by applying a math and strin…
Reverse Bits
Reverse a 32-bit unsigned integer by manipulating bits efficiently using a divide and conquer approach with careful bit …
Number of 1 Bits
Number of 1 Bits is a classic bit manipulation problem where clearing the lowest set bit gives the cleanest count.
Happy Number
Determine if a number is happy by repeatedly summing squares of digits using two-pointer scanning to detect cycles effic…
Remove Linked List Elements
Remove all nodes from a linked list that have a specific value, adjusting pointers to preserve the rest of the list.
Isomorphic Strings
Determine if two strings are isomorphic by checking if one string can be transformed into the other using character repl…
Reverse Linked List
Reverse a singly linked list in place, converting the head to tail, with an iterative or recursive approach.
Contains Duplicate
Determine if an integer array contains any duplicate values by efficiently scanning with a hash lookup to ensure fast de…
Contains Duplicate II
Check if any two equal numbers exist within k indices using array scanning and hash table lookup efficiently.
Count Complete Tree Nodes
Count Complete Tree Nodes efficiently by leveraging binary-tree traversal, exploiting completeness, and applying bit man…
Implement Stack using Queues
This problem tests your ability to simulate a LIFO stack using two queues while preserving all standard stack operations…
Invert Binary Tree
Invert Binary Tree swaps every node's left and right children using tree traversal, with recursive DFS or iterative BFS …
Summary Ranges
Summary Ranges involves converting a sorted array of unique integers into a minimal list of range strings.
Power of Two
Determine if a given integer is a power of two using efficient math and bit manipulation techniques with optional recurs…
Implement Queue using Stacks
Implement a queue using two stacks, focusing on stack-based state management to achieve FIFO behavior in a queue.
Palindrome Linked List
Solve Palindrome Linked List by finding the midpoint, reversing the second half, and comparing mirrored nodes in linear …
Valid Anagram
Check if two strings are anagrams using hashing or sorting techniques.
Binary Tree Paths
Find all root-to-leaf paths in a binary tree using DFS and backtracking, constructing strings for each complete path eff…
Add Digits
Add Digits involves repeatedly summing digits of a number until a single digit is obtained.
Ugly Number
The Ugly Number problem asks you to determine if a number is divisible only by 2, 3, or 5.
Missing Number
Find the missing number in an array containing distinct numbers in the range [0, n].
First Bad Version
Find the first bad version of a product using binary search, minimizing the number of API calls.
Move Zeroes
Move all zeros in an array to the end while preserving the order of non-zero elements using efficient in-place operation…
Word Pattern
Solve Word Pattern by checking a one-to-one mapping between pattern letters and words using hash tables after splitting …
Nim Game
In Nim Game, determine if you can win given a certain number of stones, assuming optimal play from both players.
Range Sum Query - Immutable
The Range Sum Query - Immutable problem involves implementing a data structure to handle range sum queries efficiently.
Power of Three
Determine if a given integer is a power of three using math and recursion techniques.
Counting Bits
Compute the number of 1 bits for every integer from 0 to n using state transition dynamic programming for efficiency.
Power of Four
Determine if a given integer is a power of four using math insights and bit manipulation tricks efficiently in code.
Reverse String
Reverse a character array in-place using a two-pointer scanning technique, ensuring minimal memory and correct index swa…
Reverse Vowels of a String
Reverse Vowels of a String uses a two-pointer approach to reverse the vowels in a string while leaving the consonants in…
Intersection of Two Arrays
Find the intersection of two arrays while ensuring unique elements using efficient array scanning and hash lookups.
Intersection of Two Arrays II
Find the intersection of two arrays, accounting for multiple occurrences of the same number.
Valid Perfect Square
Determine if a given positive integer is a perfect square using a binary search approach over potential square roots eff…
Guess Number Higher or Lower
Find the picked number efficiently using binary search while adjusting guesses based on higher or lower feedback in this…
Ransom Note
Determine if a ransom note can be constructed from a magazine's letters using hash tables and string counting techniques…
First Unique Character in a String
Find the index of the first non-repeating character in a string using efficient queue-driven state processing.
Find the Difference
Find the Difference involves identifying the additional letter in one string compared to another, emphasizing hash table…
Is Subsequence
Determine if one string is a subsequence of another using state transition dynamic programming for accurate character ma…
Binary Watch
Binary Watch involves generating possible times on a binary watch given a number of turned-on LEDs.
Sum of Left Leaves
Compute the total of all left leaves in a binary tree using precise traversal and state tracking techniques for correctn…
Convert a Number to Hexadecimal
Convert a 32-bit integer to its hexadecimal string using math operations and careful string manipulation techniques.
Longest Palindrome
Determine the length of the longest palindrome constructible from a given string using greedy counting and frequency tra…
Fizz Buzz
Generate a list from 1 to n replacing multiples of 3 with Fizz, 5 with Buzz, and both with FizzBuzz efficiently.
Third Maximum Number
Find the third distinct maximum number in an array using array traversal and sorting techniques, handling duplicates car…
Add Strings
Given two non-negative integers as strings, sum them and return the result as a string without converting to integers di…
Number of Segments in a String
Count the segments of non-space characters in a string by applying a string-driven approach to solve the problem.
Arranging Coins
Determine the maximum number of complete staircase rows possible with n coins using a binary search approach.
Find All Numbers Disappeared in an Array
Identify all missing numbers in an array using efficient scanning and hash-based lookup for optimal performance.
Assign Cookies
Maximize content children by assigning at most one cookie per child using two-pointer scanning and greedy sorting techni…
Repeated Substring Pattern
Check if a string can be constructed by repeating a substring using string matching techniques.
Hamming Distance
Calculate the Hamming distance between two integers by counting differing bit positions.
Island Perimeter
Determine the perimeter of an island in a grid of land and water cells using DFS or BFS.
Number Complement
The Number Complement problem requires flipping bits in a number’s binary representation to return its complement.
License Key Formatting
Reformat a license key string by splitting into groups of size k, converting to uppercase, and handling dashes appropria…
Max Consecutive Ones
Find the maximum sequence of consecutive 1s in a binary array using an efficient array-driven scanning approach.
Construct the Rectangle
Given an area, design a rectangle with integer length and width optimizing L >= W and minimal difference, using math.
Teemo Attacking
Compute the total poisoned time Ashe experiences from Teemo's attacks using an array-based simulation approach efficient…
Next Greater Element I
Find the next greater element for each number in nums1 from the nums2 array using an optimized approach.
Keyboard Row
Identify all words from a list that can be typed using letters from only one row of a standard American keyboard.
Find Mode in Binary Search Tree
Find Mode in Binary Search Tree asks to identify the most frequent element(s) in a BST using binary-tree traversal.
Base 7
Convert any given integer to its base 7 string representation using efficient math and string manipulation techniques.
Relative Ranks
Solve Relative Ranks by sorting scores with original indices, then writing medal labels or numeric places back in answer…
Perfect Number
Check if a given number is a perfect number by verifying if it's equal to the sum of its divisors, excluding itself.
Fibonacci Number
Calculate the nth Fibonacci number using state transition dynamic programming and recursive techniques efficiently in in…
Detect Capital
Detect Capital asks you to determine if a word follows a correct capital usage pattern based on specific rules.
Longest Uncommon Subsequence I
Determine the length of the longest uncommon subsequence between two strings using a direct string comparison strategy.
Minimum Absolute Difference in BST
Find the minimum absolute difference between values of any two nodes in a BST using tree traversal and careful state tra…
Reverse String II
Reverse String II requires reversing segments of a string using two-pointer scanning while tracking invariants carefully…
Diameter of Binary Tree
The Diameter of Binary Tree problem involves finding the longest path between any two nodes using tree traversal techniq…
Student Attendance Record I
Determine if a student's attendance record qualifies for an award based on specific criteria for absences and lateness.
Reverse Words in a String III
Reverse Words in a String III involves reversing each word in a sentence using the two-pointer technique.
Maximum Depth of N-ary Tree
Find the maximum depth of an N-ary tree, leveraging tree traversal techniques and state tracking.
Array Partition
Maximize the sum of minimums of n pairs in a 2n integer array using a greedy pairing strategy efficiently.
Binary Tree Tilt
Calculate the sum of the binary tree's node tilts using tree traversal and state tracking.
Reshape the Matrix
Reshape the Matrix involves transforming a 2D matrix into a new matrix with the same elements in row-major order, follow…
Subtree of Another Tree
Determine if one binary tree is an exact subtree of another by comparing structure and node values recursively.
Distribute Candies
Maximize the number of different candies Alice can eat given a set of candies and constraints on quantity.
N-ary Tree Preorder Traversal
Solve the N-ary Tree Preorder Traversal problem using depth-first search and stack-based traversal methods.
N-ary Tree Postorder Traversal
Postorder traversal of an N-ary tree can be efficiently solved using DFS and stack-based methods, tracking state across …
Longest Harmonious Subsequence
Find the length of the longest harmonious subsequence in an integer array using array scanning and hash-based frequency …
Range Addition II
Range Addition II requires counting maximum values in a matrix after incremental operations using array and math reasoni…
Minimum Index Sum of Two Lists
Find the common strings between two lists with the smallest index sum in this easy problem involving array scanning and …
Can Place Flowers
Determine if n new flowers can be planted in a flowerbed, ensuring no adjacent flowers using a greedy approach.
Merge Two Binary Trees
Merge Two Binary Trees requires combining nodes by summing overlapping values while preserving non-null nodes from eithe…
Maximum Product of Three Numbers
Find three numbers in an array whose product is the largest using sorting and careful handling of negative values.
Average of Levels in Binary Tree
Calculate the average value of nodes on each level of a binary tree using traversal and state tracking.
Maximum Average Subarray I
Find the maximum average of any contiguous subarray of length k in a given integer array using a sliding window approach…
Set Mismatch
Identify the duplicated and missing numbers in an integer array using array scanning combined with hash table lookup eff…
Two Sum IV - Input is a BST
Determine if a binary search tree contains two nodes whose values sum to a target using efficient traversal and state tr…
Robot Return to Origin
Judge whether a robot returns to the origin after a sequence of moves using string manipulation and simulation.
Image Smoother
Apply a 3x3 smoothing filter to a matrix, rounding down each cell average including surrounding neighbors for accurate r…
Second Minimum Node In a Binary Tree
Find the second minimum node in a binary tree by traversing the tree and tracking state.
Longest Continuous Increasing Subsequence
Find the length of the longest continuous increasing subsequence in an unsorted integer array using an array-driven solu…
Valid Palindrome II
Check if a string can become a palindrome by deleting at most one character using two-pointer scanning and invariant tra…
Baseball Game
Simulate baseball score operations using a stack-based approach to compute the final score after all operations.
Binary Number with Alternating Bits
Check whether a given integer has alternating bits using a bit manipulation approach.
Count Binary Substrings
Count Binary Substrings solves for the number of valid substrings with equal 0's and 1's, grouped consecutively in a bin…
Degree of an Array
Find the shortest subarray with the same degree as the given array using efficient array scanning and hash lookups.
Search in a Binary Search Tree
Locate a target value in a binary search tree and return the subtree rooted at that node using efficient tree traversal …
Kth Largest Element in a Stream
Find the kth largest element in a dynamic stream using binary-tree traversal and efficient state tracking with a min-hea…
Binary Search
Solve the Binary Search problem by finding the index of a target value in a sorted array with O(log n) complexity.
Design HashSet
Implement a custom HashSet without built-in libraries using array scanning and hash lookup for efficient membership chec…
Design HashMap
Implement a custom HashMap from scratch using array scanning and hash lookup without built-in libraries for efficient ke…
To Lower Case
The "To Lower Case" problem asks you to convert all uppercase letters in a string to lowercase.
1-bit and 2-bit Characters
Determine whether the last character in a binary array represents a one-bit character or a two-bit character.
Find Pivot Index
Find the pivot index in an array where the sums of elements on both sides are equal using array and prefix sum technique…
Self Dividing Numbers
Identify self-dividing numbers in a given range by verifying divisibility against their digits.
Flood Fill
Flood Fill is an array and DFS problem where you change connected pixels to a target color efficiently using recursion o…
Find Smallest Letter Greater Than Target
Locate the smallest character in a sorted array that is strictly greater than a given target using efficient binary sear…
Min Cost Climbing Stairs
Compute the minimum cost to reach the top of a staircase using dynamic programming and step-by-step state transitions ef…
Largest Number At Least Twice of Others
Determine if the largest number in the array is at least twice as large as every other element, and return its index or …
Shortest Completing Word
Find the shortest word that completes the license plate by matching all required letters, considering frequency and case…
Prime Number of Set Bits in Binary Representation
Count numbers with prime set bits in a binary representation within a given range.
Toeplitz Matrix
Determine if a given matrix is a Toeplitz matrix by checking diagonal consistency.
Jewels and Stones
Given two strings, determine how many of the stones you have are also jewels, considering case sensitivity.
Minimum Distance Between BST Nodes
Find the minimum difference between values of two different nodes in a Binary Search Tree using tree traversal and state…
Rotate String
Determine if one string can be rotated into another by repeatedly shifting characters, leveraging string matching techni…
Unique Morse Code Words
Determine how many unique Morse code transformations can be generated from a list of words using a hash table and array …
Number of Lines To Write String
Calculate how many lines are needed to write a string given individual letter widths, constrained to 100 pixels per line…
Largest Triangle Area
Find the area of the largest triangle formed by three distinct points on a 2D plane.
Most Common Word
Find the most frequent non-banned word in a paragraph, excluding punctuation, using an efficient array scan and hash tab…
Shortest Distance to a Character
Compute the minimum distance from each character in a string to a target character using efficient scanning techniques.
Goat Latin
Convert a sentence to Goat Latin by transforming each word based on vowel rules and incremental suffixes efficiently.
Positions of Large Groups
Identify and return intervals of consecutive, large character groups in a string of lowercase letters.
Flipping an Image
Flip each row of a binary matrix horizontally and invert its values efficiently using a two-pointer scanning approach.
Rectangle Overlap
Determine if two axis-aligned rectangles overlap based on their coordinates.
Backspace String Compare
Compare two strings after processing backspaces using efficient two-pointer scanning and careful invariant tracking to e…
Buddy Strings
Determine if two strings can become equal by swapping exactly two letters using a hash table for character tracking.
Lemonade Change
Determine if you can provide exact change to every customer at a lemonade stand using greedy bill management techniques.
Transpose Matrix
Transpose Matrix problem requires flipping a matrix's rows and columns to return the transposed version.
Binary Gap
Find the maximum distance between consecutive 1's in a number's binary form using precise bit manipulation techniques.
Leaf-Similar Trees
Determine if two binary trees have identical leaf sequences using efficient traversal and state tracking techniques.
Middle of the Linked List
Find the middle node of a singly linked list using a two-pointer technique.
Projection Area of 3D Shapes
Calculate the projection area of a 3D shape defined by a grid of towers with varying heights.
Uncommon Words from Two Sentences
Find uncommon words from two sentences by counting word frequencies using hash tables.
Fair Candy Swap
Determine which single candy box Alice and Bob should swap to equalize their total candies using array scanning and hash…
Surface Area of 3D Shapes
Solve the Surface Area of 3D Shapes problem using array manipulation and mathematical formulas to calculate surface area…
Monotonic Array
Determine if an integer array is entirely monotone increasing or decreasing using a clear array-driven approach.
Increasing Order Search Tree
Rearrange a binary search tree so all nodes follow increasing order with only right children using in-order traversal.
Sort Array By Parity
Reorder an integer array so all even numbers come before odd numbers using a precise two-pointer scanning method.
Smallest Range I
Find the smallest score of an array after applying an operation to each element within a given range.
X of a Kind in a Deck of Cards
Solve the problem of determining if a deck can be partitioned into groups with equal occurrences of card values.
Reverse Only Letters
Reverse the characters of a string while skipping non-letter characters using a two-pointer technique.
Sort Array By Parity II
Sort an array where even numbers appear at even indices and odd numbers appear at odd indices using two-pointer scanning…
Long Pressed Name
Check if a typed string could result from long pressing characters while typing a given name using a two-pointer scan.
Unique Email Addresses
Identify the count of unique email addresses by normalizing local names and using hash-based lookups efficiently.
Number of Recent Calls
The "Number of Recent Calls" problem involves designing a class to efficiently track recent requests within a time windo…
Range Sum of BST
Given a BST and a range, calculate the sum of all node values within that range.
Valid Mountain Array
The 'Valid Mountain Array' problem requires determining if an array meets the conditions of a valid mountain array using…
DI String Match
Reconstruct a permutation from a DI string using two-pointer scanning, carefully tracking the increasing and decreasing …
Delete Columns to Make Sorted
The 'Delete Columns to Make Sorted' problem asks to remove unsorted columns from a string array, ensuring all columns ar…
Verifying an Alien Dictionary
Verify if a sequence of words is sorted according to an alien language's custom alphabet order using array scanning and …
N-Repeated Element in Size 2N Array
Find the element that is repeated exactly N times in a 2N-sized array using array scanning and hash lookups.
Univalued Binary Tree
Determine if a binary tree is uni-valued using traversal and state tracking techniques.
Largest Perimeter Triangle
Given an integer array, find the largest perimeter of a triangle formed from three of these lengths.
Squares of a Sorted Array
The problem involves squaring elements of a sorted array and returning the squares in non-decreasing order.
Add to Array-Form of Integer
Compute the sum of an integer and a number represented as an array, efficiently handling digit carries and array travers…
Cousins in Binary Tree
Determine if two nodes in a binary tree are cousins by leveraging binary-tree traversal and state tracking.
Find the Town Judge
Find the Town Judge is an easy LeetCode problem that challenges you to identify a town judge from trust relationships us…
Available Captures for Rook
This problem involves finding the number of pawns a rook can capture on a chessboard, considering obstacles like bishops…
Find Common Characters
Return an array of common characters from all strings in the given list of words, including duplicates.
Maximize Sum Of Array After K Negations
Maximize the sum of an integer array after exactly k negations using a greedy approach and invariant tracking for optima…
Complement of Base 10 Integer
In this problem, you need to return the complement of a given integer by flipping its binary digits.
Partition Array Into Three Parts With Equal Sum
Determine if an array can be partitioned into three non-empty parts with equal sum using greedy choice and validation.
Binary Prefix Divisible By 5
Determine which binary prefixes of a given array are divisible by 5 using bit manipulation for efficient checks.
Remove Outermost Parentheses
Remove Outermost Parentheses simplifies a valid parentheses string by removing the outermost layers of parentheses in ea…
Sum of Root To Leaf Binary Numbers
Calculate the sum of binary numbers from root to leaf paths in a binary tree.
Divisor Game
Divisor Game is a game theory problem where players take turns subtracting divisors of a number n until one player loses…
Matrix Cells in Distance Order
Compute all matrix cell coordinates sorted by Manhattan distance from a given center using array and math techniques eff…
Valid Boomerang
Determine if three points on a 2D plane form a boomerang, based on distinctness and non-collinearity.
Last Stone Weight
In the 'Last Stone Weight' problem, we smash the two heaviest stones until one remains, using heaps or sorting.
Remove All Adjacent Duplicates In String
Solve Remove All Adjacent Duplicates In String by simulating deletions with a stack that collapses matching neighbors im…
Height Checker
Determine how many students are out of place in a line by comparing their heights to the sorted expected order efficient…
Greatest Common Divisor of Strings
Find the greatest common divisor string between two strings based on the math and string patterns.
Occurrences After Bigram
Extract the third word in every adjacent triple of words matching a given bigram pattern from a text.
Duplicate Zeros
Duplicate each zero in a fixed-length array in place, shifting elements right using a two-pointer scanning approach effi…
Distribute Candies to People
Distribute candies to people in a way that follows a mathematical pattern, ensuring the distribution is correct.
Defanging an IP Address
Transform an IPv4 address by replacing each period with '[.]', focusing on a string-driven, direct manipulation approach…
Relative Sort Array
Sort arr1 by the relative order of arr2, with remaining elements placed in ascending order.
Number of Equivalent Domino Pairs
Count all pairs of dominoes that are equivalent by scanning the array and using a hash table for fast lookup.
N-th Tribonacci Number
Compute the N-th Tribonacci number using state transition dynamic programming with careful memoization and iterative upd…
Day of the Year
Calculate the day number of the year based on a given Gregorian calendar date in the format YYYY-MM-DD.
Find Words That Can Be Formed by Characters
Compute the total length of words that can be fully constructed from given characters using array scanning and hash mapp…
Prime Arrangements
Calculate the number of valid permutations of 1 to n where prime numbers occupy prime indices using math-driven logic.
Distance Between Bus Stops
Compute the minimal distance between two bus stops on a circular route using an array-driven solution approach.
Day of the Week
Given a date, calculate the corresponding weekday using a math-based strategy, focusing on modular arithmetic.
Maximum Number of Balloons
Find the maximum number of times the word 'balloon' can be formed from characters of the given string.
Minimum Absolute Difference
Find all pairs with the minimum absolute difference between two elements in an array, and return them in ascending order…
Unique Number of Occurrences
Determine if each integer in an array occurs a unique number of times using efficient hash-based counting and verificati…
Minimum Cost to Move Chips to The Same Position
Compute the minimum cost to move all chips to one position using parity-based greedy moves efficiently.
Split a String in Balanced Strings
Split a string into the maximum number of balanced substrings where each substring has an equal number of 'L' and 'R'.
Check If It Is a Straight Line
Determine if a series of coordinates form a straight line on a 2D plane using geometry and mathematical principles.
Cells with Odd Values in a Matrix
This problem involves updating a matrix based on given indices and counting cells with odd values afterward.
Shift 2D Grid
Shift 2D Grid requires shifting elements of a matrix by a given number of times, simulating step-by-step movement.
Minimum Time Visiting All Points
Calculate the minimum seconds required to visit all given 2D points in order using optimal diagonal or straight moves.
Find Winner on a Tic Tac Toe Game
Determine the winner of a Tic Tac Toe game by scanning moves and using hash lookups for rows, columns, and diagonals eff…
Subtract the Product and Sum of Digits of an Integer
Calculate the difference between the product and sum of an integer's digits using a simple math-driven approach for effi…
Element Appearing More Than 25% In Sorted Array
Identify the integer occurring more than 25% in a sorted array using a precise array-driven search strategy for efficien…
Convert Binary Number in a Linked List to Integer
Convert a binary number represented in a linked list to its decimal value using efficient pointer manipulation.
Find Numbers with Even Number of Digits
Count the integers in an array that have an even number of digits using a direct array traversal with digit math.
Replace Elements with Greatest Element on Right Side
Replace every element in an array with the greatest element on its right side, and replace the last element with -1.
Find N Unique Integers Sum up to Zero
Generate an array of n unique integers that sum to zero using a symmetric pairing strategy to ensure balance.
Decrypt String from Alphabet to Integer Mapping
Decrypt a string using alphabet-to-integer mapping, considering the presence of '#' as a special delimiter.
Decompress Run-Length Encoded List
Decompress a run-length encoded list by expanding each pair into repeated values based on frequency.
Convert Integer to the Sum of Two No-Zero Integers
Find two positive integers whose sum equals n and neither contains the digit zero, using a direct math-driven approach.
Maximum 69 Number
Maximize a number by flipping at most one digit from 6 to 9 or vice versa.
Rank Transform of an Array
Transform the elements of an array into their ranks, where the rank represents the size order of the elements.
Remove Palindromic Subsequences
This problem challenges you to remove palindromic subsequences from a string with a minimum number of steps using two-po…
The K Weakest Rows in a Matrix
Find the k weakest rows in a binary matrix where rows contain soldiers and civilians, using sorting and binary search te…
Number of Steps to Reduce a Number to Zero
Reduce a number to zero using bit manipulation and math. Simulate the process step-by-step based on whether the number i…
Check If N and Its Double Exist
Solve Check If N and Its Double Exist by scanning once and checking doubles or halves in a hash set.
Count Negative Numbers in a Sorted Matrix
Count Negative Numbers in a Sorted Matrix requires counting negative numbers in a matrix sorted in non-increasing order …
Sort Integers by The Number of 1 Bits
Sort an array of integers by the number of 1's in their binary representation and then by their value in case of ties.
Number of Days Between Two Dates
Calculate the exact number of days between two dates using string parsing and arithmetic logic with consistent accuracy.
How Many Numbers Are Smaller Than the Current Number
In this problem, you need to determine how many numbers are smaller than each element in an array, focusing on array sca…
Increasing Decreasing String
Reorder the string based on a specific algorithm using hash tables and string manipulation.
Generate a String With Characters That Have Odd Counts
Generate a string of n characters where each character appears an odd number of times, using a string-driven approach.
Find a Corresponding Node of a Binary Tree in a Clone of That Tree
Find the corresponding node in a cloned binary tree using binary-tree traversal and state tracking.
Lucky Numbers in a Matrix
The Lucky Numbers in a Matrix problem involves finding elements that are the minimum in their row and maximum in their c…
Find the Distance Value Between Two Arrays
Calculate the distance value between two integer arrays by determining how many elements in arr1 don't have a close coun…
Create Target Array in the Given Order
Learn how to efficiently create a target array by inserting elements at specified indices using array simulation techniq…
Find Lucky Integer in an Array
Identify the largest lucky integer in an array by counting frequencies and comparing values with their occurrences effic…
Count Largest Group
Count the number of groups with the largest size by summing digits of numbers from 1 to n using a hash table approach.
Minimum Subsequence in Non-Increasing Order
Find the minimum subsequence in non-increasing order such that its sum exceeds the sum of non-included elements.
String Matching in an Array
Identify all strings in an array that appear as substrings of other strings, focusing on array and string matching patte…
Minimum Value to Get Positive Step by Step Sum
Find the minimum starting value to ensure the step-by-step sum of an array is always at least 1.
Reformat The String
Reformat The String involves rearranging alphanumeric characters in a string so that no adjacent characters have the sam…
Maximum Score After Splitting a String
Find the optimal split point in a binary string to maximize zeros on the left and ones on the right efficiently.
Kids With the Greatest Number of Candies
Determine which kids, after receiving extra candies, will have the greatest number of candies in a group.
Destination City
Find the destination city from a list of paths where each path connects two cities. The city with no outgoing path is th…
Check If All 1's Are at Least Length K Places Away
Check if all 1's in a binary array are at least k places away from each other.
Consecutive Characters
Find the power of a string by determining the length of its longest substring with a unique character.
Number of Students Doing Homework at a Given Time
Count the number of students doing homework at a given time using an array-driven solution approach.
Check If a Word Occurs As a Prefix of Any Word in a Sentence
Determine the first word in a sentence where a given searchWord is a prefix using two-pointer scanning with string match…
Make Two Arrays Equal by Reversing Subarrays
Solve Make Two Arrays Equal by Reversing Subarrays by checking whether target and arr contain the same values with match…
Maximum Product of Two Elements in an Array
Find the maximum product of two elements in an array by carefully selecting indices and leveraging sorting for efficienc…
Shuffle the Array
Shuffle the Array requires an efficient approach to rearrange elements using an array-driven solution strategy with two …
Final Prices With a Special Discount in a Shop
Calculate final prices with discounts applied in a shop using a stack-based state management approach to find the correc…
Running Sum of 1d Array
Calculate the running sum of a given 1D array by updating each element to the sum of itself and all previous elements.
XOR Operation in an Array
Compute the bitwise XOR of a dynamically generated array using a combination of math and bit manipulation techniques eff…
Average Salary Excluding the Minimum and Maximum Salary
Calculate the average salary of employees, excluding the highest and lowest salaries, from an array of unique salaries.
Path Crossing
Check if a path crosses itself on a 2D plane using a hash table to track visited points during traversal.
Can Make Arithmetic Progression From Sequence
Determine if a given array can be rearranged into a valid arithmetic progression using sorting and consecutive differenc…
Reformat Date
Reformat Date requires transforming a date string from human-readable form to YYYY-MM-DD using a string-driven strategy …
Number of Good Pairs
Count all index pairs in an array where elements match and the first index is smaller, using hash-based scanning efficie…
Water Bottles
Maximize the number of water bottles you can drink by simulating the exchange process between full and empty bottles.
Count Odd Numbers in an Interval Range
Count Odd Numbers in an Interval Range efficiently using a math-driven formula that avoids unnecessary iteration over la…
Shuffle String
Reorder characters in a string using a given indices array to reconstruct the intended output efficiently and correctly.
Count Good Triplets
Count Good Triplets requires identifying all triplets in an array that satisfy multiple absolute difference constraints …
Kth Missing Positive Number
Find the kth missing positive integer in a strictly increasing array using binary search over the answer space efficient…
Make The String Great
This problem requires removing adjacent characters that cancel each other out, leveraging stack-based state management.
Three Consecutive Odds
Determine if an integer array contains three consecutive odd numbers using a direct array-driven solution strategy for f…
Thousand Separator
Convert a given integer into a string with dots as thousand separators using a precise string-driven strategy.
Most Visited Sector in a Circular Track
Determine which sectors on a circular track are visited most frequently using array and simulation techniques efficientl…
Detect Pattern of Length M Repeated K or More Times
Determine if a subarray of length m repeats k or more consecutive times in a given integer array efficiently.
Matrix Diagonal Sum
Calculate the sum of both primary and secondary diagonals in a square matrix while avoiding double-counting overlaps.
Replace All ?'s to Avoid Consecutive Repeating Characters
Solve LeetCode 1576 by scanning left to right and replacing each ? with a letter different from its neighbors.
Special Positions in a Binary Matrix
Identify all special positions in a binary matrix where a 1 has no other 1s in its row or column, ensuring optimal array…
Sum of All Odd Length Subarrays
Calculate the sum of all odd-length subarrays in a given integer array using efficient array and math strategies.
Rearrange Spaces Between Words
Rearrange spaces between words by distributing them evenly, placing any leftover spaces at the end to match original tex…
Crawler Log Folder
Simulate folder navigation based on a list of operations to determine the current folder depth.
Design Parking System
Implement a class to manage a parking lot with fixed slots for big, medium, and small cars, tracking occupancy efficient…
Special Array With X Elements Greater Than or Equal X
Determine if an array has exactly x elements greater than or equal to x using binary search over the answer space.
Maximum Nesting Depth of the Parentheses
Find the maximum nesting depth of parentheses in a valid string using stack-based state management.
Mean of Array After Removing Some Elements
Calculate the trimmed mean by removing the lowest and highest 5% of elements in an array using sorting for accuracy and …
Largest Substring Between Two Equal Characters
Find the longest substring between two equal characters using a hash table for optimized performance.
Slowest Key
Determine which key had the longest press duration in a sequence using array indices and string mapping, resolving ties …
Sort Array by Increasing Frequency
Sort Array by Increasing Frequency requires counting each element and ordering them by frequency, breaking ties with des…
Widest Vertical Area Between Two Points Containing No Points
Find the maximum width of a vertical area between points with no points inside using array sorting efficiently.
Check Array Formation Through Concatenation
Determine if an array can be formed by concatenating subarrays without reordering individual elements, using hash lookup…
Get Maximum in Generated Array
Compute the maximum value in a generated array using defined recurrence rules, leveraging array simulation techniques ef…
Defuse the Bomb
Defuse the Bomb uses a sliding window to update a circular array based on a key, with efficient state updates.
Design an Ordered Stream
Design an Ordered Stream that returns values in increasing order based on unique integer IDs with efficient insertion an…
Check If Two String Arrays are Equivalent
Determine if two string arrays form identical strings by concatenating elements in order, handling subtle array-length m…
Maximum Repeating Substring
Find the maximum number of times a given word repeats consecutively in a string using state transition dynamic programmi…
Richest Customer Wealth
Calculate the richest customer's wealth by summing the amounts in each customer's bank accounts in a matrix.
Goal Parser Interpretation
Interpret the Goal Parser's output by analyzing a command string containing 'G', '()', and '(al)' patterns.
Count the Number of Consistent Strings
Count the number of strings fully composed of allowed characters using array scanning and hash lookup for efficiency.
Count of Matches in Tournament
Calculate the total matches in a tournament by simulating rounds and applying simple math rules for advancing teams.
Reformat Phone Number
Reformat a phone number by removing spaces and dashes, grouping digits into blocks of 3 or 2, and joining them with dash…
Number of Students Unable to Eat Lunch
Simulate a queue of students with sandwich preferences and determine how many can't eat based on available sandwiches.
Determine if String Halves Are Alike
Check if two halves of a string contain the same number of vowels using a character counting approach efficiently.
Maximum Units on a Truck
Maximize total units loaded on a truck by choosing boxes greedily based on highest units per box within truck capacity l…
Calculate Money in Leetcode Bank
Calculate the total amount of money in the Leetcode bank at the end of the nth day, based on a weekly increasing deposit…
Decode XORed Array
Recover the original integer array from its XOR-encoded version using direct bitwise manipulation and sequential reconst…
Number Of Rectangles That Can Form The Largest Square
Determine how many rectangles can be trimmed to form the largest possible square using an array-driven solution strategy…
Find the Highest Altitude
Find the highest altitude after a series of altitude changes during a road trip using prefix sum technique.
Latest Time by Replacing Hidden Digits
Determine the latest valid time by replacing hidden digits using a greedy choice and invariant validation strategy effic…
Maximum Number of Balls in a Box
The problem asks you to find the box with the maximum number of balls based on the sum of digits of ball numbers.
Sum of Unique Elements
Given an array, find the sum of all its unique elements by identifying those that appear only once.
Check if Array Is Sorted and Rotated
Determine if a given integer array is sorted in non-decreasing order and then rotated, handling duplicates correctly.
Minimum Changes To Make Alternating Binary String
Find the minimum number of changes required to convert a string into an alternating binary string.
Longest Nice Substring
Find the longest nice substring in a given string using the sliding window technique with running state updates.
Merge Strings Alternately
Merge two strings alternately, starting with the first string, and append extra characters when one string is longer.
Count Items Matching a Rule
Count Items Matching a Rule is an easy problem that tests array and string manipulation with conditions based on specifi…
Find Nearest Point That Has the Same X or Y Coordinate
Find the nearest point with the same x or y coordinate using Manhattan distance. Return its index or -1 if none exists.
Check if Binary String Has at Most One Segment of Ones
Check if a binary string contains at most one contiguous segment of ones.
Check if One String Swap Can Make Strings Equal
Check if one string swap can make two equal strings using hash table and string counting methods.
Find Center of Star Graph
Find the center node of a star graph, where one node connects to all others.
Second Largest Digit in a String
Given a string with alphanumeric characters, find the second largest digit, or return -1 if it doesn’t exist.
Maximum Ascending Subarray Sum
Solve Maximum Ascending Subarray Sum by scanning once, extending rising runs, and resetting the running sum at each drop…
Number of Different Integers in a String
Count all unique integers in a string by replacing letters and handling leading zeros correctly with a hash table approa…
Determine Color of a Chessboard Square
Determine whether a given chessboard square is white or black by converting coordinates using a math plus string approac…
Truncate Sentence
Truncate a sentence to contain only the first k words by converting it into an array of words.
Sign of the Product of an Array
Determine the sign of a product from an integer array using a single pass without computing the full product.
Minimum Operations to Make the Array Increasing
Calculate the minimum number of increments required to transform a given integer array into a strictly increasing sequen…
Check if the Sentence Is Pangram
Determine if a given lowercase string contains every English letter using efficient hash table tracking techniques.
Sum of Digits in Base K
Calculate the sum of digits of a number after converting it from base 10 to any given base using a math-driven approach.
Replace All Digits with Characters
Transform a string by replacing digits at odd indices using the preceding character with a shift operation for accurate …
Minimum Distance to the Target Element
Solve Minimum Distance to the Target Element by scanning the array and tracking the smallest distance from start.
Maximum Population Year
Find the earliest year with the highest population using an array plus counting approach.
Sorting the Sentence
Reconstruct a shuffled sentence by sorting words using their embedded indices to restore the original sentence order eff…
Sum of All Subset XOR Totals
Compute the sum of all subset XOR totals using a backtracking search with pruning for arrays of small size.
Longer Contiguous Segments of Ones than Zeros
Determine if the longest segment of 1s in a binary string is strictly longer than the longest segment of 0s.
Substrings of Size Three with Distinct Characters
Count all substrings of length three in a string where each character is unique using sliding window techniques efficien…
Check if Word Equals Summation of Two Words
Check if the sum of two word values equals a target word's value by converting letters to their numeric representations.
Determine Whether Matrix Can Be Obtained By Rotation
Determine if a binary matrix can be transformed into another by rotating it 90 degrees multiple times.
Check if All the Integers in a Range Are Covered
Check if all integers in the range [left, right] are covered by intervals in a given set of ranges.
Redistribute Characters to Make All Strings Equal
Determine if you can redistribute characters among strings so that all strings become identical using a counting approac…
Largest Odd Number in String
Find the largest odd number in a string using a greedy approach with careful digit inspection and invariant checks.
Remove One Element to Make the Array Strictly Increasing
Determine if removing a single element from an array can make it strictly increasing, using a careful index check approa…
Maximum Product Difference Between Two Pairs
Find the maximum product difference between two pairs in an integer array using sorting for optimal selection.
Build Array from Permutation
The problem asks to build an array from a given permutation using an efficient approach.
Count Square Sum Triples
Count Square Sum Triples asks to find the number of integer triples where a² + b² = c² for values between 1 and n.
Concatenation of Array
This problem asks you to create an array of double the size, where each element is repeated twice in sequence.
Maximum Number of Words You Can Type
Determine how many words can be typed on a malfunctioning keyboard with some broken keys.
Check if All Characters Have Equal Number of Occurrences
Check if a string has characters with equal occurrences using hash tables and string manipulation techniques.
Sum of Digits of String After Convert
Convert a lowercase string into digits and repeatedly sum them k times using a direct string plus simulation approach.
Three Divisors
Determine if a given integer has exactly three positive divisors.
Delete Characters to Make Fancy String
This problem asks to remove the minimum number of characters from a string to ensure no three consecutive characters are…
Check If String Is a Prefix of Array
Determine if a string is a prefix of an array by concatenating initial elements, using two-pointer scanning efficiently.
Number of Strings That Appear as Substrings in Word
Count how many strings in an array appear as substrings within a given word by checking each pattern individually.
Find if Path Exists in Graph
Determine if a valid path exists between two vertices in a bi-directional graph using traversal techniques.
Minimum Time to Type Word Using Special Typewriter
Compute the minimum typing time by greedily taking the shorter circular move between consecutive letters, then adding on…
Find Greatest Common Divisor of Array
Find the greatest common divisor of the smallest and largest numbers in an integer array.
Minimum Difference Between Highest and Lowest of K Scores
Minimize the difference between the highest and lowest of k student scores using a sliding window approach.
Find the Middle Index in Array
Find the smallest middle index where the sum of elements on the left equals the sum on the right using prefix sums effic…
Count Special Quadruplets
Count Special Quadruplets requires scanning arrays and using hash lookups to efficiently find quadruplets matching sum c…
Reverse Prefix of Word
Reverse the prefix of a string starting from index 0 to the first occurrence of a given character.
Count Number of Pairs With Absolute Difference K
Find how many pairs (i, j) with i < j satisfy |nums[i] - nums[j]| == k using array scanning and hash lookup.
Final Value of Variable After Performing Operations
Compute the final value of X by simulating each string operation in the array sequentially with careful tracking.
Maximum Difference Between Increasing Elements
Find the maximum difference between two increasing elements in an array using a linear scan to track the minimum value e…
Convert 1D Array Into 2D Array
Convert a 1D integer array into a structured 2D array with specified rows and columns using all elements sequentially.
Minimum Moves to Convert String
Minimize moves to convert a string of 'X' and 'O' to all 'O' by converting three consecutive characters to 'O'.
Two Out of Three
Identify all elements appearing in at least two of three arrays using efficient scanning and hash lookups for fast verif…
Minimum Number of Moves to Seat Everyone
Calculate the minimum total moves to seat each student using greedy assignment and invariant validation efficiently.
Check if Numbers Are Ascending in a Sentence
Check if the numbers in a sentence are strictly increasing from left to right using string tokenization.
Number of Valid Words in a Sentence
Count all valid words in a sentence by analyzing each token with precise string-driven validation rules efficiently.
Kth Distinct String in an Array
Find the kth distinct string in an array by identifying strings that appear only once, using efficient array scanning an…
Smallest Index With Equal Value
Find the smallest index where the index mod 10 equals the value at that index in the given array.
Count Vowel Substrings of a String
Count the number of vowel substrings that include all five vowels in a string.
Check Whether Two Strings are Almost Equivalent
Solve Check Whether Two Strings are Almost Equivalent by counting letters and rejecting any character whose frequency ga…
Time Needed to Buy Tickets
Calculate the total time for a specific person to buy all their tickets using queue-driven state processing.
Two Furthest Houses With Different Colors
Maximize the distance between two houses with different colors by using a greedy approach and validating the choice.
Count Common Words With One Occurrence
Learn how to efficiently count strings appearing exactly once in both arrays using array scanning and hash lookup patter…
Find Target Indices After Sorting Array
Find the target indices of a sorted array and return them in increasing order using binary search and sorting techniques…
Finding 3-Digit Even Numbers
Generate unique 3-digit even numbers from a given array of digits with duplicates.
Find Subsequence of Length K With the Largest Sum
Pick the k largest values, then restore their original order to build the maximum-sum subsequence correctly.
Rings and Rods
Count how many rods have all three colors using a hash table to track colors per rod efficiently in strings.
Find First Palindromic String in the Array
Return the first palindromic string from an array of words or an empty string if none exists.
Maximum Number of Words Found in Sentences
Find the maximum number of words in a single sentence from an array of sentences using array and string processing techn…
A Number After a Double Reversal
Determine if reversing a number twice returns the original integer by analyzing trailing zeros and digit placement.
Check if All A's Appears Before All B's
Determine if all 'a's in a string appear before any 'b's using a direct string-driven check strategy for clarity and cor…
Capitalize the Title
Capitalize the Title requires transforming each word based on length, applying uppercase and lowercase rules precisely p…
Check if Every Row and Column Contains All Numbers
Determine if every row and column in a square matrix contains all numbers from 1 to n without repetition using array sca…
Divide a String Into Groups of Size k
Divide a string into equal groups of size k, using a fill character to complete the last group if needed.
Minimum Cost of Buying Candies With Discount
Minimize the total cost of buying candies using a greedy approach with a discount system based on candy prices.
Count Elements With Strictly Smaller and Greater Elements
Count elements in an array that have both strictly smaller and strictly greater numbers using array sorting efficiently.
Keep Multiplying Found Values by Two
The "Keep Multiplying Found Values by Two" problem involves repeatedly multiplying a number by two if it is found in an …
Minimum Sum of Four Digit Number After Splitting Digits
Find the minimum sum of two 2-digit numbers by splitting a four-digit number into two integers.
Sort Even and Odd Indices Independently
Rearrange a 0-indexed array by sorting even and odd indices independently for predictable order and correctness.
Count Operations to Obtain Zero
Simulate operations on two integers until one becomes zero, counting how many steps it takes to achieve the result.
Count Equal and Divisible Pairs in an Array
Given an array, count pairs of elements that are equal and their indices product is divisible by a given integer.
Count Integers With Even Digit Sum
Solve this Easy Math plus Simulation problem by counting numbers whose digit sums are even up to a given limit efficient…
Counting Words With a Given Prefix
Count how many words in a list start with a given prefix.
Most Frequent Number Following Key In an Array
Scan the array once, count which value appears right after the key, and return the uniquely most frequent follower.
Cells in a Range on an Excel Sheet
This problem requires extracting a range of cells from an Excel-like sheet based on a string input and returning them in…
Find All K-Distant Indices in an Array
Identify all indices in an array that are within k distance of elements equal to the given key using two-pointer scannin…
Divide Array Into Equal Pairs
Determine if an array of 2n integers can be partitioned into n pairs where each pair contains identical elements using h…
Count Hills and Valleys in an Array
Count Hills and Valleys in an Array determines the number of hills and valleys in a given array by analyzing index neigh…
Find the Difference of Two Arrays
Find the Difference of Two Arrays helps you identify unique elements between two integer arrays using array scanning and…
Minimum Bit Flips to Convert Number
Determine the minimum number of bit flips required to convert one integer to another using precise bit manipulation.
Minimum Number of Operations to Convert Time
The problem asks to find the minimum number of operations to convert one time string to another using specific time incr…
Largest Number After Digit Swaps by Parity
Maximize a number by swapping digits of the same parity using sorting and priority queue techniques efficiently.
Add Two Integers
This problem asks to return the sum of two integers within a specific range, focusing on math-driven solution strategy.
Root Equals Sum of Children
Check if a binary tree root value equals the sum of its immediate left and right child nodes efficiently.
Find Closest Number to Zero
Identify the number in an integer array that is closest to zero, returning the larger one if tied.
Calculate Digit Sum of a String
Learn how to repeatedly sum digit groups in a string until its length is at most k using string simulation techniques.
Intersection of Multiple Arrays
Find integers that are common across all arrays in a given list of arrays.
Count Prefixes of a Given String
Count Prefixes of a Given String is a problem that involves finding the number of string prefixes in an array that match…
Remove Digit From Number to Maximize Result
Determine the largest possible number by removing one specific digit using a greedy approach and string iteration.
Largest 3-Same-Digit Number in String
Find the largest 3-same-digit number within a string of digits using a string-driven solution approach.
Find the K-Beauty of a Number
Calculate the k-beauty of a number by counting substrings of length k that divide the original number evenly using a sli…
Find Resultant Array After Removing Anagrams
This problem requires removing adjacent anagrams from a list of words using an array scanning and hash lookup approach.
Percentage of Letter in String
Calculate the percentage of a specific letter in a string using a direct string-driven counting approach, rounding down …
Check if Number Has Equal Digit Count and Digit Value
Determine if a number's digits correspond to their counts in the string representation.
Rearrange Characters to Make Target String
Calculate the maximum copies of a target string from letters in s using frequency counting and hash tables efficiently.
Min Max Game
The Min Max Game problem requires simulating an array reduction process to find the last remaining number.
Strong Password Checker II
Check if a given password meets all strength requirements, including length, character types, and no adjacent repeated c…
Calculate Amount Paid in Taxes
Calculate the total tax owed by iterating through sorted brackets and applying each rate incrementally to your income.
Greatest English Letter in Upper and Lower Case
Find the greatest English letter that exists in both lowercase and uppercase in a string using a hash table approach.
Count Asterisks
The 'Count Asterisks' problem asks you to count '*' excluding those between pairs of '|' in a string.
Check if Matrix Is X-Matrix
Check if a square matrix follows the X-Matrix pattern by validating diagonal and non-diagonal conditions.
Decode the Message
Decode the Message is an easy problem involving hash table mapping for string decoding based on a cipher key.
Evaluate Boolean Binary Tree
Determine the boolean outcome of a full binary tree by evaluating leaf and internal nodes using depth-first traversal.
Minimum Amount of Time to Fill Cups
Determine the minimum seconds to fill cups of cold, warm, and hot water using a greedy selection strategy and invariant …
Maximum Number of Pairs in Array
Given an array, count how many pairs can be formed and how many leftovers remain after pairing.
Best Poker Hand
Determine the strongest poker hand from five cards using array scanning and hash table counting techniques efficiently.
First Letter to Appear Twice
Find the first letter that repeats in a string using hash table tracking and early detection for efficiency.
Make Array Zero by Subtracting Equal Amounts
Minimize operations to make all array elements zero by subtracting equal amounts in each operation.
Merge Similar Items
Merge Similar Items combines values and weights from two lists, returning the result sorted by value.
Number of Arithmetic Triplets
Count the number of arithmetic triplets in a given strictly increasing array with a specified difference.
Largest Local Values in a Matrix
Find the largest value in every 3x3 submatrix of an n x n integer matrix efficiently using nested loops.
Minimum Recolors to Get K Consecutive Black Blocks
Given a string of blocks, determine the minimum number of recolors needed to get k consecutive black blocks.
Minimum Hours of Training to Win a Competition
Find the minimum hours of training needed to beat all opponents in a competition based on energy and experience.
Longest Subsequence With Limited Sum
Find the maximum size of a subsequence from nums with a sum less than or equal to each query value.
Find Subarrays With Equal Sum
Find Subarrays With Equal Sum is solved by scanning adjacent pairs and storing each length-2 sum in a hash set.
Check Distances Between Same Letters
Verify if each pair of identical letters in a string has the exact number of letters between them as specified in a dist…
Most Frequent Even Element
Identify the most frequent even element in an array using counting and hash lookup, handling ties by choosing the smalle…
Count Days Spent Together
Count the total number of days Alice and Bob are in Rome together, given their arrival and departure dates.
Smallest Even Multiple
Find the smallest even multiple of a given integer using math and number theory concepts efficiently.
Sort the People
Sort the People requires pairing names with heights and sorting them in descending height order efficiently using arrays…
Remove Letter To Equalize Frequency
Determine if removing a single letter from a string can make all remaining letters have identical frequency efficiently.
Number of Common Factors
The problem asks to find the number of common factors of two positive integers a and b.
The Employee That Worked on the Longest Task
Identify which employee spent the longest time on a task using an array-driven approach, analyzing each log entry effici…
Number of Valid Clock Times
Calculate how many valid digital clock times can be formed by replacing unknown digits in a string format hh:mm.
Largest Positive Integer That Exists With Its Negative
Find the largest positive integer in an array such that its negative counterpart also exists.
Determine if Two Events Have Conflict
Compare two same-day time intervals and check whether their inclusive endpoints overlap after converting HH:MM strings i…
Odd String Difference
Identify the one string in an array whose consecutive letter differences deviate from all others using array scanning pl…
Average Value of Even Numbers That Are Divisible by Three
Find the average of even numbers divisible by 3 from an array of positive integers.
Apply Operations to an Array
Transform an array by applying adjacent doubling operations and shifting zeros efficiently using two-pointer scanning te…
Number of Distinct Averages
Calculate the number of unique averages formed by repeatedly pairing smallest and largest elements efficiently using has…
Convert the Temperature
Convert the given Celsius temperature to Kelvin and Fahrenheit using mathematical formulas and return the result in an a…
Number of Unequal Triplets in Array
Count all triplets in a positive integer array where each element is distinct using scanning and hash lookup efficiently…
Minimum Cuts to Divide a Circle
Calculate the fewest cuts required to divide a circle into n equal slices using math and geometric reasoning efficiently…
Find the Pivot Integer
Find the Pivot Integer problem challenges you to identify an integer x that balances prefix sums on both sides.
Circular Sentence
Determine if a sentence is circular by verifying each word's last character matches the next word's first character effi…
Maximum Value of a String in an Array
The problem requires finding the maximum value of alphanumeric strings in an array based on length or numeric value.
Delete Greatest Value in Each Row
Calculate the total of removed maximum values from each row of a matrix, iterating until all columns are deleted efficie…
Count Pairs Of Similar Strings
Count similar string pairs by converting each word into a character-set signature and counting matching signatures effic…
Maximum Enemy Forts That Can Be Captured
Find the maximum number of enemy forts that can be captured by moving your army using two-pointer scanning with invarian…
Shortest Distance to Target String in a Circular Array
Find the shortest distance to a target string in a circular array with either left or right movement options.
Count the Digits That Divide a Number
Count the digits that divide a number by checking each digit's divisibility.
Categorize Box According to Criteria
Classify a box as "Heavy", "Bulky", or "Neither" based on its dimensions and mass using math-driven strategies.
Maximum Count of Positive Integer and Negative Integer
Compute the maximum count between positive and negative integers in a sorted array using efficient binary search countin…
Difference Between Element Sum and Digit Sum of an Array
Find the absolute difference between element sum and digit sum of an array of integers.
Minimum Common Value
Find the smallest integer appearing in both sorted arrays efficiently using array scanning and hash-based lookup techniq…
Alternating Digit Sum
Compute the alternating digit sum by applying a sign to each digit and summing efficiently using a math-driven approach.
Count Distinct Numbers on Board
Compute the number of distinct integers generated on a board using repeated modulo operations over a long sequence of da…
Separate the Digits in an Array
Given an array of positive integers, separate each integer into its individual digits while preserving the original orde…
Take Gifts From the Richest Pile
Take Gifts From the Richest Pile uses a heap to simulate the process of taking gifts from the richest pile over a number…
Find the Array Concatenation Value
Compute the array concatenation value efficiently using two-pointer scanning while maintaining a running total of concat…
Maximum Difference by Remapping a Digit
Find the largest difference by remapping a single digit in a number using a greedy approach to maximize and minimize out…
Merge Two 2D Arrays by Summing Values
Merge two 2D arrays by summing values with matching ids using array scanning and hash lookup efficiently.
Left and Right Sum Differences
Compute absolute differences between left and right cumulative sums for each element in an integer array efficiently.
Split With Minimum Sum
Split a positive integer into two parts to minimize their sum using a greedy approach and sorting.
Pass the Pillow
Pass the Pillow simulates the process of passing an item through a line of people, adjusting the direction based on time…
Count the Number of Vowel Strings in Range
Count the Number of Vowel Strings in Range asks to count vowel strings in a subarray of a given word list.
Distribute Money to Maximum Children
Determine the maximum number of children who can each receive exactly 8 dollars using a greedy approach with validation …
Number of Even and Odd Bits
Count the number of 1s at even and odd indices in the binary representation of a given integer n.
K Items With the Maximum Sum
Select k items from a bag containing 1, 0, and -1 to maximize sum using greedy choice and invariant validation strategie…
Form Smallest Number From Two Digit Arrays
Given two arrays of digits, find the smallest possible number formed by one digit from each array.
Find the Longest Balanced Substring of a Binary String
Find the longest balanced substring of a binary string where zeroes precede ones and counts of each are equal.
Prime In Diagonal
Find the largest prime number located on any diagonal of a square matrix using array iteration and prime checking techni…
Array Prototype Last
Implement a method on all arrays that returns the last element or -1 for empty arrays, using Array.prototype correctly.
Counter
Implement a counter function that returns increasing integers starting from a given initial value with each call, levera…
Sleep
Create an asynchronous function that sleeps for a given number of milliseconds and resolves any value.
Array Reduce Transformation
Implement the Array Reduce Transformation pattern by applying a reducer function on an array with a given initial value.
Function Composition
Learn how to implement function composition by combining multiple functions into a single callable operation efficiently…
Filter Elements from Array
Filter elements from an array based on a custom function using core interview patterns.
Apply Transform Over Each Element in Array
Transform each element in an array based on a given function without using the built-in Array.map method.
Find the Width of Columns of a Grid
This problem asks you to compute the width of each column in a grid, where the width is defined by the length of the lar…
Row With Maximum Ones
Find the row with the maximum ones in a binary matrix and return its index and count.
Find the Maximum Divisibility Score
Determine the divisor with the highest count of divisible elements in an array using a clear array-driven strategy.
Generate Fibonacci Sequence
Implement a generator that produces the Fibonacci sequence up to a specified number of elements efficiently in JavaScrip…
Calculate Delayed Arrival Time
Calculate the new arrival time of a delayed train in 24-hour format by using basic math operations.
Sum Multiples
Find the sum of integers divisible by 3, 5, or 7 in the range [1, n].
Maximum Sum With Exactly K Elements
Maximize your score by performing exactly k operations on an array using a greedy approach to select the highest values.
Determine the Winner of a Bowling Game
Simulate a bowling game to determine the winner based on hit pins per turn for two players.
Counter II
Implement a counter with functions to increment, decrement, and reset it based on an initial value.
Allow One Function Call
Learn how to wrap a function so it executes at most once, capturing results while ignoring extra calls efficiently.
Create Hello World Function
The Create Hello World Function problem tests a candidate's ability to return a constant value from a function regardles…
Find the Distinct Difference Array
Calculate the distinct difference array of a given list of integers by counting distinct elements in the prefix and suff…
Chunk Array
Chunk Array splits a given array into smaller subarrays of specified size, preserving original element order and handlin…
Number of Senior Citizens
Determine how many passengers are over 60 years old based on their compressed details in an array of strings.
Find the Losers of the Circular Game
Simulate a ball-passing game around a circle using array scanning and hash lookup to find friends who never receive the …
Array Wrapper
The Array Wrapper problem focuses on implementing a class that wraps an array to perform operations like addition or str…
Minimum String Length After Removing Substrings
Determine the smallest string length after repeatedly removing AB or CD substrings using stack-based simulation techniqu…
Lexicographically Smallest Palindrome
Given a string, make it a palindrome with the fewest operations, prioritizing lexicographically smallest result.
Return Length of Arguments Passed
Determine the number of arguments passed to a function, practicing direct counting of parameters in real-time function c…
To Be Or Not To Be
Implement a function 'expect' to help developers test values using 'toBe' and 'notToBe' methods.
Buy Two Chocolates
Determine the leftover money after buying exactly two chocolates using a greedy selection and sum validation approach.
Remove Trailing Zeros From a String
Remove trailing zeros from a string representing a positive integer number.
Timeout Cancellation
Learn to implement timeout cancellation logic for function execution using a custom cancel function.
Minimize String Length
Minimize String Length asks you to reduce a string by removing duplicates using a Hash Table strategy efficiently.
Semi-Ordered Permutation
Find the minimum number of operations to convert a permutation into a semi-ordered permutation where 1 is first and n is…
Add Two Promises
The problem 'Add Two Promises' involves adding the resolved values of two promises and returning the result.
Sort By
Sort By requires sorting an array using a custom function, producing ascending order based on function outputs efficient…
Interval Cancellation
Implement a cancellable function with repeated executions at fixed intervals before a cancellation time.
Calculator with Method Chaining
Design a Calculator class that supports method chaining for mathematical operations like addition, subtraction, multipli…
Is Object Empty
Determine if a given object or array is empty by checking its keys or length efficiently in interviews.
Check if The Number is Fascinating
Determine if a 3-digit number is fascinating by checking if the concatenated result of n, 2*n, and 3*n contains all digi…
Neither Minimum nor Maximum
Find a number in an array that is neither the minimum nor maximum value, or return -1 if no such number exists.
Total Distance Traveled
Calculate the maximum distance a truck can travel using main and additional fuel tanks with controlled transfers.
Find Maximum Number of String Pairs
Find the maximum number of pairs of distinct strings from an array where one string is the reverse of the other.
Number of Beautiful Pairs
Count all index pairs in an array where the first digit of one number and last digit of another are coprime efficiently.
Longest Even Odd Subarray With Threshold
Determine the length of the longest subarray where elements alternate even and odd while staying below a given threshold…
Longest Alternating Subarray
Find the longest alternating subarray in a given array of integers.
Find the Maximum Achievable Number
Determine the largest number achievable by repeatedly applying a simple math operation up to t times efficiently.
Sum of Squares of Special Elements
Calculate the sum of squares of special elements in a 1-indexed array using index divisibility checks efficiently.
Check if Array is Good
Determine if a given integer array is a permutation of base[n], containing 1 to n-1 once and n twice, using scanning and…
Split Strings by Separator
Split Strings by Separator requires iterating through an array of strings and splitting each by a given separator charac…
Number of Employees Who Met the Target
Determine how many employees reach the required work hours using a direct array-driven counting approach.
Account Balance After Rounded Purchase
Given a purchase amount, calculate the account balance after rounding the purchase to the nearest multiple of 10 and ded…
Faulty Keyboard
Simulate typing on a faulty keyboard where pressing 'i' reverses the string, requiring careful string manipulation track…
Max Pair Sum in an Array
Find the maximum sum of two numbers in an array sharing the same largest digit using a hash-based scan efficiently.
Count Pairs Whose Sum is Less than Target
This problem asks you to count all index pairs in an array whose sum is strictly less than a given target value efficien…
Check if a String Is an Acronym of Words
Check if a string can be formed by concatenating the first letters of each word in a given list.
Furthest Point From Origin
Determine the maximum distance from origin using string moves and counting underscores optimally for efficient calculati…
Check if Strings Can be Made Equal With Operations I
Determine if two strings can be made equal by repeatedly swapping characters at any two indices in each string.
Count Symmetric Integers
Count Symmetric Integers finds numbers where the sum of the first half of digits equals the sum of the second half withi…
Points That Intersect With Cars
Count covered integer points by merging overlapping car intervals or marking visited positions on the number line.
Minimum Right Shifts to Sort the Array
Determine the minimum number of right shifts to sort a distinct integer array or return -1 if impossible using array ana…
Sum of Values at Indices With K Set Bits
Sum values in an array where the indices have exactly k set bits in binary representation.
Maximum Odd Binary Number
Rearrange a binary string to form the largest odd binary number using a greedy approach and least significant bit valida…
Minimum Operations to Collect Elements
Scan from the end, track seen values from 1 to k, and stop once every required number is collected.
Maximum Value of an Ordered Triplet I
Find the maximum value of a triplet in an array where indices follow the order i < j < k.
Create a DataFrame from List
Solve the problem of creating a DataFrame from a list of student data by using the pandas library.
Get the Size of a DataFrame
Learn how to efficiently calculate the number of rows and columns in a DataFrame using Python pandas for interview succe…
Display the First Three Rows
Solve a problem where you need to display the first three rows of a DataFrame in Python.
Select Data
Learn to efficiently select specific rows and columns in a dataset using the Select Data core interview pattern for accu…
Create a New Column
Create a New Column is a simple problem involving DataFrame manipulation, requiring the creation of a new column based o…
Drop Duplicate Rows
This problem requires removing duplicate rows based on the email column and retaining only the first occurrence.
Drop Missing Data
Remove rows with missing values from a dataset, focusing on the drop missing data pattern.
Modify Columns
Learn how to efficiently modify a DataFrame column by applying a transformation to every value in a single pass.
Rename Columns
This problem asks you to rename columns in a DataFrame to match a specified format using a built-in function.
Change Data Type
Correct column data types in a DataFrame, focusing on converting float columns to integers efficiently and accurately.
Fill Missing Data
Fill Missing Data is an easy-level problem that focuses on handling missing values in a dataset.
Reshape Data: Concatenate
Concatenate two DataFrames vertically by stacking rows to produce a single combined DataFrame efficiently using pandas.
Reshape Data: Pivot
Learn how to pivot data in a table so each row is a month and each city forms its own column efficiently.
Reshape Data: Melt
Reshape the data so that each row represents sales data for a product across different quarters.
Method Chaining
In Method Chaining, solve problems using sequential method calls with clean, readable code. Apply this to filter and sor…
Divisible and Non-divisible Sums Difference
Compute the difference between sums of integers divisible and non-divisible by m using a direct arithmetic approach effi…
Last Visited Integers
This problem involves finding the last visited integer for each -1 in a given array by simulating a stack-like behavior.
Longest Unequal Adjacent Groups Subsequence I
Find the longest alternating subsequence in a string array based on a binary group array.
Find Indices With Index and Value Difference I
Find two indices in an array where their difference in both index and value meets specified thresholds.
Minimum Sum of Mountain Triplets I
Find the minimum sum of a mountain triplet in an array of integers, or return -1 if no valid triplet exists.
Subarrays Distinct Element Sum of Squares I
Compute the sum of squares of distinct elements for all subarrays using array scanning with hash lookups efficiently.
Find the K-or of an Array
Given an integer array nums and an integer k, find the K-or of nums where bits qualify based on the occurrence of 1s.
Find Champion I
Find Champion I is an easy problem focusing on identifying the strongest team in a tournament using matrix-based compari…
Distribute Candies Among Children I
Given two integers n and limit, find the number of ways to distribute n candies among 3 children, with no child receivin…
Maximum Strong Pair XOR I
Find the maximum XOR of any strong pair in an integer array using array scanning and hash-based lookups efficiently.
Make Three Strings Equal
Determine the minimum number of operations to make three strings equal by removing rightmost characters from one string …
Find Words Containing Character
Identify all indices of words containing a specific character using array and string traversal techniques efficiently.
Matrix Similarity After Cyclic Shifts
Determine if a matrix returns to its original state after performing cyclic row shifts k times using array and math patt…
Find the Peaks
Identify all peaks in a mountain array using direct array enumeration and strict neighbor comparisons efficiently.
Find Common Elements Between Two Arrays
Quickly find all numbers that appear in both arrays using scanning and hash lookup to handle duplicates efficiently.
Count Tested Devices After Test Operations
Simulate testing devices based on battery percentages to determine how many pass the test operations in sequence.
Find Missing and Repeated Values
Find the missing and repeated numbers in an n x n grid using array scanning and hash lookup.
Count the Number of Incremovable Subarrays I
Count the number of incremovable subarrays in an array by removing them to create a strictly increasing sequence.
Minimum Number Game
The Minimum Number Game involves simulating moves by Alice and Bob on an array, sorting elements and appending them to a…
Check if Bitwise OR Has Trailing Zeros
Check if a bitwise OR of two or more numbers has trailing zeros in its binary representation.
Smallest Missing Integer Greater Than Sequential Prefix Sum
Find the smallest missing integer greater than the sum of the longest sequential prefix in an array.
Maximum Area of Longest Diagonal Rectangle
Find the rectangle with the longest diagonal in a 2D array and return its area, prioritizing maximum area on ties.
Count Elements With Maximum Frequency
Count Elements With Maximum Frequency is solved by counting each value, tracking the highest count, and summing matching…
Divide an Array Into Subarrays With Minimum Cost I
Divide an array into three contiguous subarrays with minimum cost by leveraging array and sorting principles.
Minimum Number of Pushes to Type Word I
Calculate the minimum pushes to type a word using a remapped telephone keypad with greedy allocation of letters.
Number of Changing Keys
Count how many times a user switches keys in a typed string, ignoring shift and caps lock variations in characters.
Type of Triangle
Determine the type of triangle from a three-element array using side sums and equality checks efficiently in constant ti…
Ant on the Boundary
Solve the problem of counting how often an ant returns to a boundary based on the steps described in the input array.
Modify the Matrix
Modify the Matrix efficiently by replacing all -1 elements with the maximum in their column using array and matrix opera…
Maximum Number of Operations With the Same Score I
Determine the maximum number of operations in an integer array where each operation must produce the same score.
Count Prefix and Suffix Pairs I
Count all index pairs where one word is both a prefix and suffix of another, using efficient array and string checks.
Split the Array
Determine if an even-length array can be split into two parts with all distinct elements using hash lookup scanning.
Minimum Operations to Exceed Threshold Value I
Count how many numbers are below k, because each such value must be removed in Minimum Operations to Exceed Threshold Va…
Distribute Elements Into Two Arrays I
Distribute elements from a distinct integer array into two subarrays using a sequential simulation strategy for optimal …
Apple Redistribution into Boxes
Distribute packs of apples into boxes using a greedy strategy, minimizing the number of boxes selected efficiently and c…
Find the Sum of Encrypted Integers
Compute the sum of encrypted integers by replacing each digit with the largest digit, combining array traversal with dig…
Existence of a Substring in a String and Its Reverse
Check for any substring of length 2 in a string and its reverse using a hash table and string comparison.
Maximum Length Substring With Two Occurrences
Find the maximum length substring where some substring occurs at least twice using a sliding window and hash mapping str…
Shortest Subarray With OR at Least K I
Find the shortest non-empty subarray in nums whose bitwise OR reaches at least k using sliding window efficiently.
Harshad Number
Given an integer, determine if it is a Harshad number by checking if it's divisible by the sum of its digits.
Longest Strictly Increasing or Strictly Decreasing Subarray
Find the longest subarray in a given array that is either strictly increasing or strictly decreasing.
Score of a String
Calculate the sum of absolute ASCII differences between adjacent characters to score any given string efficiently.
Latest Time You Can Obtain After Replacing Characters
Given a time string with "?" characters, replace them to form the latest valid 12-hour time.
Count the Number of Special Characters I
Count the number of special characters in a given string using hash tables and string manipulation.
Make a Square with the Same Color
Determine if a 3x3 grid can form a 2x2 square of the same color by changing at most one cell efficiently.
Find the Integer Added to Array I
Find the integer added to nums1 to make it equal to nums2 using an array-driven strategy.
Valid Word
Determine if a given string qualifies as a valid word using a string-driven solution pattern with explicit character rul…
Check if Grid Satisfies Conditions
Check if a grid satisfies given conditions by analyzing array and matrix structure with specific checks on values.
Permutation Difference between Two Strings
Compute the total index difference between two strings by mapping characters and summing their positional distances effi…
Special Array I
Determine if an array is special by checking alternating parity for every adjacent pair in linear time.
Find the XOR of Numbers Which Appear Twice
Find the XOR of numbers appearing twice by scanning the array and using a hash table for efficient tracking and combinat…
Find the Number of Good Pairs I
Count all good pairs where an element in nums1 is divisible by a scaled element in nums2 using efficient array scanning.
Minimum Number of Chairs in a Waiting Room
Calculate the minimum number of chairs needed in a waiting room using string simulation and event tracking efficiently.
Clear Digits
Remove all digits from a given string by applying a repeated operation to form the final string without digits.
Find the Child Who Has the Ball After K Seconds
Find the child who holds the ball after k seconds of passing in a queue, considering reversals at both ends.
Count Pairs That Form a Complete Day I
Count all pairs in an array where their sum forms a complete day using hash-based counting for efficiency.
Find Minimum Operations to Make All Elements Divisible by Three
Find the minimum number of operations to make all elements in an array divisible by three.
Minimum Average of Smallest and Largest Elements
Solve the Minimum Average of Smallest and Largest Elements problem using two-pointer scanning to track averages effectiv…
Maximum Height of a Triangle
Find the maximum height of a triangle that can be formed using red and blue balls under given constraints.
Alternating Groups I
Count all alternating groups in a circular array by tracking tiles with distinct neighbors efficiently using sliding win…
Find the Encrypted String
In this problem, you need to encrypt a string by shifting each character's position based on a given integer value.
Lexicographically Smallest String After a Swap
Lexicographically Smallest String After a Swap involves finding the smallest string after swapping adjacent digits with …
Find the Winning Player in Coin Game
In this game between Alice and Bob, players must pick coins summing to 115. Alice starts, and the goal is to determine t…
Number of Bit Changes to Make Two Integers Equal
Find the number of bit changes to make two integers equal using bit manipulation techniques.
Find if Digit Game Can Be Won
Determine if Alice can guarantee a win in a game by selectively summing single or double-digit numbers from an array.
Find the Number of Winning Players
Find how many players in a game win by picking more balls of a single color than their index position.
Design Neighbor Sum Service
Design a service that computes sums for adjacent and diagonal elements in a 2D grid.
Snake in Matrix
Solve the Snake in Matrix problem by simulating the snake's movement in a grid based on a series of directional commands…
Count Substrings That Satisfy K-Constraint I
Count all substrings in a binary string that meet a given k-constraint using an efficient sliding window approach.
Final Array State After K Multiplication Operations I
Solve the problem of determining the final state of an array after multiple multiplication operations using a priority q…
Find the Key of the Numbers
Determine the four-digit key from three given numbers using a precise math-driven approach for exact digit alignment.
Check if Two Chessboard Squares Have the Same Color
Determine if two chessboard squares share the same color using coordinate math and simple string manipulation for quick …
Convert Date to Binary
Convert a given Gregorian date string to its binary format by transforming year, month, and day individually without lea…
Find Indices of Stable Mountains
Find the indices of stable mountains in an array of mountain heights based on a threshold.
The Two Sneaky Numbers of Digitville
Find the two numbers that appear twice in a list of integers from 0 to n-1 using array scanning plus hash lookup efficie…
Minimum Element After Replacement With Digit Sum
Replace each number with its digit sum and return the smallest resulting value, using array plus math techniques efficie…
Find the K-th Character in String Game I
Find the K-th character in a progressively built string using math and bit manipulation efficiently.
Construct the Minimum Bitwise Array I
Learn how to construct an array minimizing each element while matching given primes using bitwise operations efficiently…
Find X-Sum of All K-Long Subarrays I
Compute the x-sum of every subarray of length k efficiently using array scanning combined with hash lookup techniques.
Find the Original Typed String I
Determine the length of the original string Alice intended to type by analyzing repeated characters and clumsy key press…
Check Balanced String
Determine if a numeric string is balanced by comparing sums of digits at even and odd positions efficiently.
Smallest Divisible Digit Product I
Find the smallest number greater than or equal to n whose digit product is divisible by t.
Adjacent Increasing Subarrays Detection I
Check if an array contains two adjacent strictly increasing subarrays of length k using an array-driven approach efficie…
Make Array Elements Equal to Zero
Learn how to transform an integer array to zeros using simulation and directional selection efficiently and reliably.
Stone Removal Game
Alice and Bob play a game of stone removal. Alice goes first, and the winner is the player who can make a move until the…
Minimum Positive Sum Subarray
Find the minimum sum of any subarray of size between l and r with a positive total using efficient sliding window logic.
Smallest Number With All Set Bits
Find the smallest number greater than or equal to n with all set bits in its binary representation.
Minimum Operations to Make Array Values Equal to K
Find the minimum operations to convert an array to all values equal k using array scanning and hash lookup efficiently.
Transformed Array
Simulate operations on a circular array to return a transformed result array following specific rules.
Button with Longest Push Time
Determine which button a child pressed the longest using an array-driven strategy to track time differences efficiently.
Count Subarrays of Length Three With a Condition
Determine how many subarrays of length three satisfy a sum condition on their first and third elements in an array.
Minimum Number of Operations to Make Elements in Array Distinct
Find the minimum number of operations to make all elements of an array distinct.
Minimum Operations to Make Columns Strictly Increasing
Calculate the minimum increments to make each column of a matrix strictly increasing using a greedy invariant approach.
Substring Matching Pattern
Determine if a pattern containing a single wildcard can match any substring of a given string efficiently.
Maximum Subarray With Equal Products
This problem involves finding the longest subarray where the product equals the LCM multiplied by the GCD, leveraging a …
Zigzag Grid Traversal With Skip
Traverse a 2D grid in a zigzag pattern while skipping alternate cells, focusing on array and matrix manipulation challen…
Maximum Difference Between Adjacent Elements in a Circular Array
Find the maximum absolute difference between adjacent elements in a circular array using a straightforward array-driven …
Sum of Variable Length Subarrays
Calculate the total sum of all elements in subarrays defined for each index in an array, using the array plus prefix sum…
Count Partitions with Even Sum Difference
Count the number of partitions with an even sum difference from an array of integers.
Find Valid Pair of Adjacent Digits in String
Identify the first valid adjacent digit pair in a string where each digit appears exactly as many times as its numeric v…
Maximum Difference Between Even and Odd Frequency I
Find the maximum difference between the frequency of characters in a string with odd and even frequencies.
Sum of Good Numbers
The problem asks for the sum of all good numbers in an array based on specific conditions of neighboring elements.
Find Special Substring of Length K
Check efficiently if a string contains a consecutive sequence of length k where all characters match exactly one distinc…
Check If Digits Are Equal in String After Operations I
Simulate repeated adjacent digit sums modulo 10 until two digits remain, then check whether those final digits match.
Transform Array by Parity
Transform an array by sorting even numbers first, followed by odd numbers.
Find the Largest Almost Missing Integer
Find the largest almost missing integer in an array where it appears in exactly one subarray of size k.
Fruits Into Baskets II
Determine the number of fruit types that remain unplaced after all allocations in the "Fruits Into Baskets II" problem.
Unique 3-Digit Even Numbers
Given an array of digits, find how many distinct 3-digit even numbers can be formed without repetition of digits and no …
Maximum Unique Subarray Sum After Deletion
Maximize the sum of a subarray after performing deletions, ensuring elements remain unique.
Maximum Containers on a Ship
Determine the maximum number of containers that can be loaded onto a ship's deck without exceeding weight limits.
Reverse Degree of a String
Calculate the reverse degree of a string by simulating operations on its characters based on their positions in the alph…
Minimum Cost to Reach Every Position
Calculate the minimum swap costs to reach each position in a line using a precise array-driven strategy for efficiency.
Minimum Pair Removal to Sort Array I
This problem asks for the minimum number of operations to make an array non-decreasing by removing pairs of elements.
Minimum Operations to Make Array Sum Divisible by K
This problem asks you to find the minimum operations to make the sum of an array divisible by a given integer k.
Find Closest Person
Determine which of two people reaches a third person first using a simple math-driven distance comparison strategy.
Maximum Product of Two Digits
Find the highest product obtainable from any two digits of a given positive integer using math and sorting techniques ef…
Find Most Frequent Vowel and Consonant
Given a string, calculate the sum of the most frequent vowel and consonant frequencies.
Minimum Deletions for At Most K Distinct Characters
You need to delete characters in a string to reduce its distinct characters to at most k.
Smallest Index With Digit Sum Equal to Index
Find the smallest index in an array where the sum of the digits equals the index.
Find Minimum Log Transportation Cost
Calculate the minimum cost to transport two logs using a math-driven strategy considering cutting costs and truck limits…
Generate Tag for Video Caption
Transform a video caption into a valid hashtag by simulating capitalization rules and truncation for long words efficien…
Check if Any Element Has Prime Frequency
Check if any element in the array has a prime frequency count, leveraging array scanning and hash table lookup.
Hexadecimal and Hexatrigesimal Conversion
Solve Hexadecimal and Hexatrigesimal Conversion by converting n squared to base 16 and n cubed to base 36, then joining …
Coupon Code Validator
The Coupon Code Validator problem requires filtering and sorting coupons based on specific criteria for validity.
Check Divisibility by Digit Sum and Product
Determine if a positive integer is divisible by the sum of its digits plus their product using a math-driven strategy.
Earliest Finish Time for Land and Water Rides I
Find the earliest time a tourist can finish one land and one water ride in a theme park.
Trionic Array I
Determine if an integer array contains indices forming a trionic sequence for efficient pattern detection in interviews.
Top Topics In This Track
Guided Practice Path
AI recommends problems by your level and tracks your progress.
Start Guided Patharrow_forward