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 1734: Decode XORed Permutation
You are given an array encoded of length n - 1, which represents the XOR of consecutive elements of a permutation of the first n integers. Your task is to decode the encoded array and return the original permutation perm of size n.
Leetcode 1737: Change Minimum Characters to Satisfy One of Three Conditions
You are given two strings, a and b, consisting of lowercase letters. In one operation, you can change any character in either string to any lowercase letter. Your goal is to perform the minimum number of operations to satisfy one of the following three conditions:
- Every character in string
ais strictly less than every character in stringbalphabetically. - Every character in string
bis strictly less than every character in stringaalphabetically. - Both
aandbconsist of only one distinct character.
Return the minimum number of operations needed to achieve one of these conditions.