Prefix/suffix products: For each nums index, return the product of every other value without using division.
Input: A JSON object { "nums": number[] }.
Output: A JSON number[] with the same length as nums.
Constraints:
- 0 <= nums.length <= 100000
- The result for every index fits in a safe JSON number
- Do not use division
Read one JSON value from stdin and print exactly one JSON-serialized answer to stdout with no extra text.
Difficulty: MEDIUM. Variant: 14. Expect follow-up questions about complexity, edge cases, and alternative approaches.
Practice context
This coding (algo) exercise trains prompt interpretation, explicit assumptions, a concrete response, and a concise explanation of the decisions made. It is marked medium difficulty.
The signed-in workspace provides the tools required by the round, such as recording, code execution, diagrams, structured notes, or evidence