Skip to Content
LeetCode The Hard Way

1300 - 1399

Solutions categorised by Problem IDs

1305 - All Elements in Two Binary Search TreesCombine the values from two binary search trees by sorting their traversals or merging their inorder sequences.1326 - Minimum Number of Taps to Open to Water a GardenFind the fewest taps needed to cover a garden by using each tap's watering interval to extend coverage.1328 - Break a PalindromeChange one character to turn a palindrome into the lexicographically smallest possible nonpalindrome.1329 - Sort the Matrix DiagonallySort each top-left to bottom-right matrix diagonal by grouping its values and writing them back in order.1331 - Rank Transform of an ArrayAssign ordered ranks to distinct array values after sorting, giving equal values the same rank.1334 - Find the City With the Smallest Number of Neighbors at a Threshold DistanceFind the city with the fewest neighbors within a distance threshold by computing shortest paths between cities.1335 - Minimum Difficulty of a Job ScheduleMinimize the sum of daily job difficulties by choosing day boundaries while preserving the original job order.1337 - The K Weakest Rows in a MatrixFind the k weakest matrix rows by comparing soldier counts and breaking ties by row index.1346 - Check If N and Its Double ExistDetermine whether the array contains a value and its double at distinct indices using sorted lookup.1347 - Minimum Number of Steps to Make Two Strings AnagramCount the character replacements needed to turn one string into an anagram of the other by comparing letter frequencies.1349 - Maximum Students Taking ExamMaximize exam seating by representing occupied seats with bit masks and excluding placements that allow cheating.1356 - Sort Integers by The Number of 1 BitsSort integers by their number of set bits, breaking ties by their numeric values.1359 - Count All Valid Pickup and Delivery OptionsCount valid pickup and delivery sequences by inserting each new order subject to its pickup preceding its delivery.1365 - How Many Numbers Are Smaller Than the Current NumberCount how many array elements are strictly smaller than each value by using its position in sorted order.1371 - Find the Longest Substring Containing Vowels in Even CountsFind the longest substring with even vowel counts by tracking vowel parities in a bit mask.1372 - Longest ZigZag Path in a Binary TreeFind the longest alternating left-right path in a binary tree by tracking direction during depth-first traversal.1383 - Maximum Performance of a TeamMaximize team performance by processing efficiency thresholds and using a heap to select speeds.1385 - Find the Distance Value Between Two ArraysCount values in the first array that stay more than the given distance from every value in the second array.1386 - Cinema Seat AllocationDetermine how many four-person families can sit together by using reserved-seat masks to test blocks in each cinema row.