All Posts

Leetcode 925: Long Pressed Name

Your friend is typing their name on a keyboard. Sometimes, while typing, a key might be long pressed, causing the character to be typed multiple times. Given the name and the typed string, determine if it is possible that the typed string could have been the result of long pressing some characters while typing the name.

Leetcode 926: Flip String to Monotone Increasing

You are given a binary string s consisting of only ‘0’s and ‘1’s. A binary string is called monotone increasing if all ‘0’s appear before ‘1’s. You can flip any character in the string, changing it from ‘0’ to ‘1’ or from ‘1’ to ‘0’. Your task is to return the minimum number of flips required to make the string monotone increasing.

Leetcode 949: Largest Time for Given Digits

Given an array of 4 digits, your task is to form the latest possible 24-hour time using each digit exactly once. The time is represented in the format ‘HH:MM’ where ‘HH’ is between 00 and 23, and ‘MM’ is between 00 and 59. If no valid time can be formed, return an empty string.

Leetcode 955: Delete Columns to Make Sorted II

You are given an array of strings, where each string is of the same length. You are allowed to delete any number of columns, and after deleting the selected columns, the remaining strings should be in lexicographically non-decreasing order. Your task is to determine the minimum number of columns that must be deleted to achieve this order.

Leetcode 966: Vowel Spellchecker

Design a spellchecker that corrects a given word from a query based on specific rules. For each query, find a matching word from the given wordlist by applying exact matches, case-insensitive matches, or vowel error corrections. Return the corrected word, or an empty string if no match is found.

Leetcode 981: Time Based Key-Value Store

Design a time-based key-value data structure that stores multiple values for the same key at different timestamps and supports retrieving the value at a specific timestamp.