Skip to Content
LeetCode The Hard Way

1200 - 1299

Solutions categorised by Problem IDs

1201 - Ugly Number IIIFind the nth integer divisible by at least one of three divisors by combining inclusion-exclusion with binary search.1202 - Smallest String With SwapsFind the smallest string reachable through swaps by grouping connected indices and reordering their available characters.1219 - Path with Maximum GoldCollect the most gold by exploring nonrepeating paths with depth-first search and undoing each move during backtracking.1232 - Check If It Is a Straight LineCheck whether all points lie on one straight line by comparing their relative horizontal and vertical changes.1235 - Maximum Profit in Job SchedulingMaximize profit from nonoverlapping jobs by comparing the value of taking each job with the best compatible schedule.1239 - Maximum Length of a Concatenated String with Unique CharactersMaximize the length of a concatenation with distinct characters by using bit masks to detect conflicting letters.1254 - Number of Closed IslandsCount islands enclosed by water by exploring land components and checking whether they touch the grid boundary.1259 - Handshakes That Don't CrossCount noncrossing handshakes by pairing one person and combining independent arrangements on either side.1267 - Count Servers that CommunicateUse row and column totals to count servers that share a row or column with another server.1269 - Number of Ways to Stay in the Same Place After Some StepsCount walks that return to the starting index by tracking reachable positions after each stay, left, or right move.1281 - Subtract the Product and Sum of Digits of an IntegerExtract the digits of an integer, accumulate their product and sum, and return the difference.1293 - Shortest Path in a Grid with Obstacles EliminationFind the shortest grid path with obstacle removals by including the remaining elimination budget in breadth-first search.1299 - Replace Elements with Greatest Element on Right SideReplace each element with the greatest value to its right by scanning backward and maintaining a running maximum.