LeetCode MEDIUM 1975 Maximum Matrix Sum Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

The problem in plain language

The input is a square matrix of integers. One operation chooses two cells that share an edge and reverses both signs. The operation may be repeated any number of times, and the goal is to make the matrix’s total sum as large as possible.

Continue ...

LeetCode MEDIUM 1545 Find Kth Bit in Nth Binary String Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

The problem in plain language

The problem defines a family of binary strings without asking us to construct them directly. It begins with S1 = "0". Each later string consists of three parts: the previous string, a middle 1, and a reversed copy of the previous string with every bit flipped.

Continue ...

LeetCode HARD 1526 Minimum Number of Increments on Subarrays to Form a Target Array Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

The problem in one sentence

Start with an array of zeros. One operation chooses any contiguous subarray and raises every value in it by one; the goal is to build target in as few operations as possible.

Continue ...

LeetCode MEDIUM 1461 Check If a String Contains All Binary Codes of Size K Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

The problem in one sentence

Given a binary string s and a length k, determine whether every one of the $2^k$ possible binary strings of length k appears somewhere as a contiguous substring of s.

Continue ...

LeetCode MEDIUM 1441 Build an Array With Stack Operations Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

The problem in one sentence

Starting with an empty stack, consume the stream 1, 2, ..., n in order and emit Push and Pop operations so the stack becomes exactly the strictly increasing array targetβ€”then stop immediately.

Continue ...

LeetCode MEDIUM 1358 Number of Substrings Containing All Three Characters Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

The problem in one sentence

Given a string made only of a, b, and c, count every contiguous substring that contains all three characters at least once.

Continue ...

LeetCode MEDIUM 1283 Find the Smallest Divisor Given a Threshold Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

The problem in plain language

Given a list of positive integers, choose one positive integer divisor. Divide every number by it, round each quotient up, and add the rounded values. The goal is to find the smallest divisor that makes this sum no greater than threshold.

Continue ...

LeetCode HARD 1235 Maximum Profit in Job Scheduling Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

The problem in plain language

Each job has a start time, an end time, and a profit. The goal is to choose a set of jobs that do not overlap and earn as much total profit as possible. A job ending at time x is compatible with one starting at time x.

Continue ...

LeetCode MEDIUM 1193 Monthly Transactions I Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

The problem in one picture

The Transactions table contains one row per transaction: its country, whether it was approved or declined, its amount, and its date. The requested report has one row for every (calendar month, country) pair and six columns:

Continue ...

LeetCode HARD 992 Subarrays with K Different Integers Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

Problem gist

Given an integer array nums and an integer k, count the nonempty contiguous subarrays that contain exactly k distinct values.

The word exactly makes the counting awkward. A normal sliding window is good at enforcing a one-sided condition such as β€œno more than k distinct values”: once a window has too many, move its left edge until it is valid again. But a valid window with exactly k distinct values may have several valid starting positions, so adding one answer for each right edge would miss subarrays.

Continue ...