Arrays and strings
351 practice items · needed by 19 roles
Easy 110Medium 152Hard 89
Coding problems
- Add Two Binary Stringseasy
- Alphanumeric Palindrome Checkeasy
- Balance Point of a Beameasy
- Balanced Bracket Stringeasy
- Best K-Day Sales Windoweasy
- Best Single Trade Profiteasy
- Can One Person Attend Every Booking?easy
- Cancel Adjacent Twinseasy
- Coastline Length of the Landeasy
- Compare Release Versionseasy
- Compress Character Runseasy
- Constant Diagonals Grideasy
- Cumulative Totalseasy
- Find Position in Sorted Arrayeasy
- First Non-Repeating Charactereasy
- Longest Run of Oneseasy
- Merge Two Sorted Listseasy
- Middle of a Linked Listeasy
- Minimum Opening Depositeasy
- Missing Ticket Numbereasy
- Most Common Allowed Wordeasy
- One-to-One Letter Ciphereasy
- Paginate a Result Seteasy
- Pair With Target Sumeasy
- Parse a Query Stringeasy
- Parse an Access Log Lineeasy
- Pattern Hidden in a Streameasy
- Push Zeros to the Endeasy
- Reverse Word Ordereasy
- Rotate a Matrix Clockwiseeasy
- Same Letters Checkeasy
- Sensor Moving Averageeasy
- Single-Peak Elevation Profileeasy
- Sorted Squares of Readingseasy
- Best Match by Cosine Similaritymedium
- Bucket Words by Lettersmedium
- Card Velocity and Geo Fraud Rulesmedium
- Cell Colony Next Generationmedium
- Combine Overlapping Rangesmedium
- Count Islands on a Mapmedium
- Count Subarrays With a Given Summedium
- Days Until Warmermedium
- Does a Cron Expression Match?medium
- Endpoint Report from Access Logsmedium
- Evaluate a Flat Expressionmedium
- Expand Repeat Blocksmedium
- Fewest Cable Car Podsmedium
- Fewest Probes to Touch Every Windowmedium
- Flatten Nested JSON Keysmedium
- Fold a Linked Listmedium
- Largest Concatenated Numbermedium
- Longest Balanced Bit Stretchmedium
- Longest Span With K Distinct Productsmedium
- Longest Substring With Distinct Charactersmedium
- Longest Uptime With K Repairsmedium
- Meeting Rooms Neededmedium
- Minutes Until the Rack Is Infectedmedium
- Next Bigger Value on a Ringmedium
- Parse a CSV Linemedium
- Product of All Othersmedium
- Render a Template with Filtersmedium
- Robot Paths Around Blocked Tilesmedium
- Search a Shifted Sorted Arraymedium
- Shared Free Slotsmedium
- Shortest Window Reaching a Totalmedium
- Sliding Window Rate Limitermedium
- Slot a Booking Into the Calendarmedium
- Spiral Walk of a Gridmedium
- Stretches With a Divisible Totalmedium
- Top TF-IDF Terms of a Documentmedium
- Trace a Word on a Letter Boardmedium
- Unflatten Dotted Keysmedium
- Where Does the Cycle Begin?medium
- Widest Water Containermedium
- Zero-Sum Triplesmedium
- Count Range-Bounded Sumshard
- Edit Distance Between Stringshard
- Escape the Rising Floodhard
- Evaluate a Nested Expressionhard
- Find Every Dictionary Word on the Boardhard
- Glob Pattern Matchinghard
- K-th Smallest Pair Gaphard
- Largest Skyline Rectanglehard
- Median of Two Sorted Arrayshard
- Next Run Time of a Cron Jobhard
- Parse a CSV File into Recordshard
- Rainwater on a Terrain Maphard
- Resolve Dependency Version Rangeshard
- Rolling Median of a Signalhard
- Shortest Stretch Reaching a Target (With Refunds)hard
- Shortest Word Chainhard
- Sliding Window Peakshard
- Smallest Covering Substringhard
- Solve a Sudoku Gridhard
- Stretches With Exactly K Distinct Valueshard
- Sum of Every Stretch Minimumhard
Practice questions
- Sorting numbers without a comparatoreasy
- Array.from with a lengtheasy
- replace changes only one matcheasy
- Changing one letter of a stringeasy
- reduce on an empty arraymedium
- Adding two arraysmedium
- map over new Array(3)medium
- slice versus splicemedium
- for...in over an arraymedium
- includes versus indexOf with NaNmedium
- map with parseInthard
- Comparator that returns a booleanhard
- Sorting orders that tiehard
- Arguments to a tagged templatehard
- Cost of reading arr[i]easy
- Inserting at the front of an arrayeasy
- Why push is amortized O(1)easy
- Changing one character of a stringeasy
- Reversing a simple stringeasy
- slice vs spliceeasy
- Index of the last elementeasy
- indexOf and NaNeasy
- When two pointers find a pair sumeasy
- new Array(3) then mapeasy
- Building a long string in a loopeasy
- Palindrome check with two pointerseasy
- Value missing from indexOfeasy
- Precondition for binary searcheasy
- Cleaning a pasted mobile numbereasy
- What a sliding window coverseasy
- Updating a fixed-size window sumeasy
- Range sum from a prefix arrayeasy
- Compute a range sumeasy
- Best three-day sales windoweasy
- Sliding window time complexityeasy
- Shape of a variable-size window loopeasy
- Length of a windoweasy
- Fast rectangle sums on a grideasy
- Many range increments at onceeasy
- Seven-day moving averageeasy
- How many subarrays existeasy
- Running wallet balanceeasy
- Cost of prefix sum querieseasy
- Sliding window and negative numberseasy
- First step in merging intervalseasy
- When two intervals overlapeasy
- Safe midpoint in binary searcheasy
- parseInt on a CSS valueeasy
- Number of an empty form fieldeasy
- Splitting a line with empty fieldseasy
- Where an element goes on transposeeasy
- Letter to array indexeasy
- Anagram check by sortingeasy
- Steps to find a value by binary searcheasy
- Can one person attend all meetingseasy
- Zero-padding an invoice numbereasy
- Spiral order of a 3x3 matrixeasy
- Checking balanced bracketseasy
- Case-insensitive comparison of nameseasy
- Checking whether a value is an arrayeasy
- Comparing an array with its copyeasy
- Using shift as a queueeasy
- join with null valueseasy
- Length of an emoji stringeasy
- Flattening a nested arrayeasy
- Subsequence and substringeasy
- Longest common subsequence of two stringseasy
- Operations counted by edit distanceeasy
- Edit distance from kitten to sittingeasy
- Table size for a two-string DPeasy
- Common substring versus common subsequenceeasy
- Palindromic substrings in "aaa"easy
- Booking the most meetings in one roomeasy
- Does a string have all unique characterseasy
- Does a sentence use every lettereasy
- Counting words regardless of caseeasy
- Trace a two-pointer pair searchmedium
- Remove duplicates from a sorted arraymedium
- Move zeroes to the endmedium
- Container with most water: which pointer movesmedium
- Time complexity of 3Summedium
- Reverse the words in a sentencemedium
- Rotate an array using reversalsmedium
- Rotating by more than the lengthmedium
- Merging into the larger arraymedium
- Sort 0s, 1s and 2s in one passmedium
- Squares of a sorted arraymedium
- Is one string a subsequence of anothermedium
- Copying an array of order objectsmedium
- Building a grid with fillmedium
- Comparing numeric stringsmedium
- Compute trapped rain watermedium
- Palindrome check on a real sentencemedium
- Majority element in O(1) spacemedium
- Maximum subarray summedium
- Best single buy and sellmedium
- Longest substring without repeatsmedium
- Shortest subarray reaching a targetmedium
- Character replacement window conditionmedium
- Longest run of ones with k flipsmedium
- Does a string contain an anagrammedium
- Maximum of every windowmedium
- Apply two range incrementsmedium
- Rectangle sum from a 2D prefix tablemedium
- Subarrays with product under kmedium
- Find the pivot indexmedium
- When to shrink in minimum window substringmedium
- Longest window with two distinct valuesmedium
- Counting windows with exactly kmedium
- Prefix sums overflowing intmedium
- Moving average over a streammedium
- Highest average over k valuesmedium
- XOR of a rangemedium
- Minimum starting balancemedium
- Longest run of ones after one deletionmedium
- Remove from both ends to reach xmedium
- Merge a list of intervalsmedium
- Do touching intervals mergemedium
- Minimum meeting rooms neededmedium
- Fewest intervals to removemedium
- Intersect two schedulesmedium
- First position of a repeated valuemedium
- Binary search in a rotated arraymedium
- Minimum of a rotated sorted arraymedium
- Parse an integer like atoimedium
- Rotate a square matrix in placemedium
- Set matrix zeroes with O(1) spacemedium
- Splitting CSV with quoted commasmedium
- Evaluate an expression with precedencemedium
- Decode a nested repeat stringmedium
- Comparing version stringsmedium
- Roman numeral to integermedium
- Run-length compression of a stringmedium
- Longest common prefixmedium
- Binary search a matrix as one arraymedium
- Insert a new intervalmedium
- Next greater elementmedium
- Days until a warmer daymedium
- forEach on an array with holesmedium
- Overflow in an Int32Arraymedium
- Reading the last elementmedium
- All duplicates with O(1) extra spacemedium
- Is one string a rotation of anothermedium
- Where to start a circular routemedium
- Ways to decode a digit stringmedium
- Decoding a string that starts with zeromedium
- Splitting text into dictionary wordsmedium
- Longest palindromic subsequencemedium
- Longest palindromic substring in O(1) spacemedium
- Ways a word appears as a subsequencemedium
- Checking an interleaving of two stringsmedium
- Handling "*" in regex matching DPmedium
- Wildcard "*" versus regex "*"medium
- Fewest bookings to cancelmedium
- Group anagrams togethermedium
- Duplicate within k positionsmedium
- Isomorphic stringsmedium
- Matching words to a patternmedium
- First non-repeating charactermedium
- Repeated 10-letter DNA sequencesmedium
- Most common words in support ticketsmedium
- Which Sudoku box a cell belongs tomedium
- Longest palindrome from given lettersmedium
- Words that appear in only one sentencemedium
- Characters common to every wordmedium
- Duplicate accounts with different email spellingmedium
- Bouncing a ball off the floormedium
- Is the player in front of the guardmedium
- Enemy vanishes on reaching playermedium
- Why rain water two pointers move the lower sidehard
- Kadane returns 0 for all negativeshard
- Avoiding duplicate triplets in 3Sumhard
- Next lexicographic permutationhard
- Find the duplicate without extra spacehard
- Product of array except selfhard
- Smallest missing positive integerhard
- Median of two sorted arrayshard
- Quickselect for the k-th largesthard
- Reversing a string that has emojihard
- Boyer–Moore without a guaranteed majorityhard
- Maximum product subarrayhard
- Sorting a file larger than memoryhard
- Removing items while looping forwardhard
- Dutch flag: when mid must not advancehard
- Shortest subarray with sum at least K, with negativeshard
- Sliding window medianhard
- Substrings containing a, b and chard
- Maximum sum of a circular subarrayhard
- Maximum sum rectangle in a matrixhard
- Running time of minimum window substringhard
- The non-shrinking window trickhard
- Sum of all subarray sumshard
- Running totals of rupee amountshard
- Range updates mixed with range querieshard
- Rate limiting with a time windowhard
- Subarrays with exactly two distinct valueshard
- Why the max deque stores indexeshard
- Bug in a minimum length windowhard
- Fewest swaps to group all oneshard
- Minimum eating speed by binary searchhard
- Least ship capacity for a deadlinehard
- Binary search that never endshard
- Common free time across many calendarshard
- Most meetings in one roomhard
- Search a matrix sorted by rows and columnshard
- KMP failure tablehard
- Rabin–Karp and hash collisionshard
- Longest palindromic substringhard
- Parsing a date-only stringhard
- Two identical-looking names that differhard
- Sorting file names with numbershard
- Counting inversionshard
- Largest number from concatenationhard
- Fewest arrows for overlapping balloonshard
- Largest rectangle in a histogramhard
- Sum of all subarray minimumshard
- Remove k digits for the smallest numberhard
- Asteroid collisionhard
- Sorting by two keys with a stable sorthard
- Shortest string containing two stringshard
- Fewest cuts into palindromeshard
- Matching customer names with typoshard
- Breaking text into neat lineshard
- Fewest rooms for overlapping meetingshard
- Reducing rolling hash collisionshard
- Bug in an at-most-two-distinct windowhard
- Distinct values in every windowhard
- Rows that match columns in a gridhard
- Do two booking slots overlaphard
- Getting the first charactermedium
- Counting an emojihard
- Direction from enemy to playereasy
- Distance between two pointseasy
- Cheaper range checkseasy
- Normalising a zero vectoreasy
- What a unit vector iseasy
- Scaling a velocity vectoreasy
- Speed along a slopemedium
- Bouncing a ball off a wallmedium
- Sliding along a wallmedium
- Normal of a trianglemedium
- Area from a cross productmedium
- Angle from the dot productmedium
- Camera flips when looking straight downmedium
- strncpy and the missing terminatormedium
- An array exactly the string lengthhard
- Detecting snprintf truncationhard
- f-string with an equals signeasy
- Building a long string in a loopmedium
- Filtering text with missing valuesmedium