All Posts

Leetcode 1727: Largest Submatrix With Rearrangements

You are given a binary matrix with dimensions m x n consisting of 0’s and 1’s. You can rearrange the columns of the matrix in any order. The task is to find the area of the largest submatrix within the matrix where every element is 1 after optimally reordering the columns.

Leetcode 1733: Minimum Number of People to Teach

In a social network consisting of multiple users and their friendships, users can communicate with each other only if they share a common language. You are given a list of languages each user knows and a list of friendships between users. Your task is to teach a single language to some users such that all the users in each friendship can communicate. The goal is to minimize the number of users you need to teach the new language.

Leetcode 1736: Latest Time by Replacing Hidden Digits

You are given a time string in the format hh:mm, where some digits may be missing and represented by a question mark (?). Your task is to replace the ? with digits to form the latest valid time in the 24-hour format, which is between 00:00 and 23:59.

Leetcode 1753: Maximum Score From Removing Stones

You are given three piles of stones, with sizes a, b, and c respectively. In each turn, you can choose two different non-empty piles, remove one stone from each, and add 1 point to your score. The game stops when there are fewer than two non-empty piles left, meaning no more valid moves are available. Your task is to return the maximum score you can achieve.

Leetcode 1754: Largest Merge Of Two Strings

You are given two strings, word1 and word2. You need to construct a string merge by choosing characters from both strings. At each step, you can either append the first character of word1 to merge (if word1 is non-empty) or append the first character of word2 to merge (if word2 is non-empty). The goal is to form the lexicographically largest string possible from these choices.

Leetcode 1764: Form Array by Concatenating Subarrays of Another Array

Given an array of subarrays groups and a single array nums, your task is to determine whether it is possible to extract each subarray from groups as a contiguous segment from nums. The subarrays must appear in the same order as in groups, and they should be disjoint, meaning no element from nums can belong to more than one subarray. Return true if this is possible, and false otherwise.