Two Sum

Medium

📝 Description

Find indices of two numbers that add up to target value

Input Format

First line: space-separated array elements Second line: target sum

Output Format

Indices of two numbers

Constraints

2 ≤ array length ≤ 10^4 -10^9 ≤ elements ≤ 10^9

🔍 Sample Input

2 7 11 15
9
            

✅ Sample Output

0 1
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run