LeetCode MEDIUM 143 Reorder List Summary

Generated by Codex with GPT 5.6 Sol XHigh

Quick facts

  • Difficulty: MEDIUM
  • Problem: Reorder List
  • Topics: Linked List, Two Pointers, Stack, Recursion

Problem gist

The input is a singly linked list in its ordinary front-to-back order:

L0 → L1 → L2 → ... → Ln

It must be rearranged by alternating nodes from the front and back:

Continue ...

LeetCode MEDIUM 142 Linked List Cycle II Summary

Generated by Codex with GPT 5.6 Sol XHigh

Quick facts

Problem gist

A singly linked list may eventually point back to an earlier node instead of ending at None. The task is to return the exact node where that cycle begins, or None if the list has no cycle. The list must not be modified.

Continue ...

LeetCode MEDIUM 116 Populating Next Right Pointers in Each Node Summary

Generated by Codex with GPT 5.6 Sol XHigh

Quick facts

Problem gist

Each node in a perfect binary tree has an extra next pointer. The task is to make that pointer lead to the node immediately to its right on the same level, or to None when the node is the level’s last one.

Continue ...

LeetCode HARD Count Nodes in a Distributed Tree Summary

Generated by Codex with GPT 5.6 Sol High

Quick facts

  • Difficulty: HARD
  • Problem: Custom LeetCode-style prompt: Count Nodes in a Distributed Tree
  • Topics: Distributed Systems, Tree, Asynchronous Programming, State Machine, Idempotency

Problem gist

Every tree node runs in a separate process or on a separate machine. A node knows only its parent and its direct children, and it can communicate with them only by sending asynchronous messages.

Continue ...

LeetCode MEDIUM 105 Construct Binary Tree from Preorder and Inorder Traversal Summary

Generated by Codex with GPT 5.6 Sol XHigh

Quick facts

Problem gist

Two arrays describe the same binary tree:

  • Preorder visits each node before its children: root, left subtree, right subtree.
  • Inorder visits each node between its children: left subtree, root, right subtree.

The task is to rebuild and return the tree. Every value is unique, and the two arrays are guaranteed to describe the same tree.

Continue ...

LeetCode MEDIUM 3738 Longest Non-Decreasing Subarray After Replacing at Most One Element Summary

Generated by Codex with GPT 5.6 Sol XHigh

Quick facts

Problem gist

Given an integer array, one element may be replaced with any integer. The goal is to maximize the length of a contiguous subarray whose values never decrease from left to right.

Continue ...

LeetCode HARD 2188 Minimum Time to Finish the Race Summary

Generated by Codex with GPT 5.6 Sol XHigh

Quick facts

Problem gist

Each tire type is described by [f, r]. A fresh tire completes its first lap in f seconds, but keeping it for consecutive laps makes it geometrically slower: its next lap times are f, f * r, f * r^2, and so on. There is an unlimited supply of every tire type. Between laps, the driver may spend changeTime seconds to put on any fresh tire.

Continue ...

LeetCode HARD 2035 Partition Array Into Two Arrays to Minimize Sum Difference Summary

Generated by Codex with GPT 5.6 Sol XHigh

Quick facts

Problem gist

The input contains 2 * n integers. Every number must go into one of two arrays, and each array must contain exactly n numbers. The goal is to make the absolute difference between the two array sums as small as possible.

Continue ...

LeetCode MEDIUM 1877 Minimize Maximum Pair Sum in Array Summary

Generated by Codex with GPT 5.6 Sol XHigh

Quick facts

Problem gist

An even-length array must be divided into pairs, with every element used exactly once. Each pair has a sum, and the score of a complete pairing is its largest pair sum. The goal is to make that worst pair as small as possible.

Continue ...

LeetCode MEDIUM 1415 The k-th Lexicographical String of All Happy Strings of Length n Summary

Generated by Codex with GPT 5.6 Sol XHigh

Quick facts

Problem gist

A happy string uses only a, b, and c, and no two neighboring characters may be equal. The task is to consider every happy string of length n in lexicographic order and return the k-th one. If fewer than k such strings exist, the answer is the empty string.

Continue ...