As reported: Microsoft SDE 2 (hiring drive, Oct 2025), round 1 (DSA): LeetCode Product of Array Except Self, then Sum Root to Leaf Numbers.
Given an integer array nums, return answer where answer[i] is the product of all elements except nums[i]. Run in O(n) without using division.
This is LeetCode 238 — Product of Array Except Self.
Example 1
nums = [1,2,3,4] -> [24,12,8,6]
Example 2
nums = [-1,1,0,-3,3] -> [0,0,9,0,0]
Constraints: 2 ≤ nums.length ≤ 10^5; -30 ≤ nums[i] ≤ 30; every prefix and suffix product fits in a 32-bit integer.
Code runner format: one JSON value per line: nums (LeetCode's test-case format). Implement productExceptSelf(nums); the harness prints the array.