All Posts

Leetcode 1975: Maximum Matrix Sum

You are given a square matrix of integers. You can perform the following operation multiple times: choose any two adjacent elements in the matrix and multiply both of them by -1. Your goal is to maximize the sum of the matrix elements after performing the operation any number of times.

Leetcode 1976: Number of Ways to Arrive at Destination

You are in a city with n intersections, and roads connecting them with specific travel times. Your task is to find the number of different ways you can travel from intersection 0 to intersection n-1 in the shortest time possible. Since the result could be large, return it modulo (10^9 + 7).

Leetcode 1980: Find Unique Binary String

You are given an array of unique binary strings, each of length n. Your task is to find and return a binary string of length n that is not present in the given array. There can be multiple valid solutions.

Leetcode 1981: Minimize the Difference Between Target and Chosen Elements

You are given an m x n integer matrix, where each row contains n integers. You are also given a target integer. Your task is to choose one integer from each row of the matrix such that the absolute difference between the target and the sum of the chosen elements is minimized. Return the minimum absolute difference.

Leetcode 1985: Find the Kth Largest Integer in the Array

You are given an array of strings nums, where each string represents a non-negative integer. You need to find the kth largest integer in the array. Note that duplicates should be considered distinctly. For example, if the array is [‘1’, ‘2’, ‘2’], the first largest integer is ‘2’, the second largest is also ‘2’, and the third largest is ‘1’.

Leetcode 1986: Minimum Number of Work Sessions to Finish the Tasks

You are assigned several tasks, each with a specified time required to complete. A work session allows you to work continuously for up to sessionTime consecutive hours before taking a break. Your goal is to determine the minimum number of work sessions required to complete all tasks under the following conditions:

  • If a task is started in a session, it must be completed within that same session.
  • You may complete the tasks in any order.
  • You can begin a new task immediately after finishing the previous one.

Return the minimum number of work sessions needed to complete all tasks.