All Posts

Leetcode 686: Repeated String Match

You are given two strings, a and b. You need to find the minimum number of times you should repeat string a so that string b becomes a substring of the repeated a. If it is impossible, return -1.

Leetcode 692: Top K Frequent Words

Given a list of words and an integer k, return the k most frequent words in the list. The words should be sorted by their frequency in descending order. If two words have the same frequency, they should be sorted lexicographically.

Leetcode 712: Minimum ASCII Delete Sum for Two Strings

Given two strings s1 and s2, return the lowest ASCII sum of deleted characters to make the two strings equal.

Leetcode 720: Longest Word in Dictionary

Given an array of strings words, return the longest word in the list that can be built progressively one character at a time by other words in the list.

Leetcode 721: Accounts Merge

You are given a list of accounts, where each account consists of a name and a list of emails. Merge accounts that share common emails, and return the merged accounts in the format: name followed by sorted emails.

Leetcode 722: Remove Comments

You are given a C++ program represented as an array of strings, where each string corresponds to a line of code. Your task is to remove all comments from the code. The two types of comments in C++ are line comments (//) and block comments (/* … */). After removing comments, return the modified code as an array of strings, excluding any empty lines.