You are handed an array of integer measurements `nums` and a target value `target`.
Return the indices of the two measurements that add up to `target`. You may assume exactly one valid answer exists, and you cannot use the same reading twice.
If you have ever scanned a gel for two bands that sum to a known weight, you already understand the shape of this problem — we are just making it formal.
Input: nums = [2, 7, 11, 15], target = 9
Output: [0, 1]
Note: nums[0] + nums[1] = 2 + 7 = 9.
Input: nums = [3, 2, 4], target = 6
Output: [1, 2]
// hit Run to execute the sample tests
// Interactive editor preview. Live code execution arrives with your early-access cohort.