Two Sum

You are given an integer array nums and an integer target. Return the indices of two distinct elements whose values add up to target. Return the indices in ascending order. Exactly one valid pair exists, and the same element cannot be used twice.

Examples
Input: [[2,7,11,15],9]
Output: [0,1]
Hints

Two Sum

You are given an integer array `nums` and an integer `target`. Return the indices of two distinct elements whose values add up to `target`. Return the indices in ascending order. Exactly one valid pair exists, and the same element cannot be used twice.