Two Sum (C# and Python3)

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

You can return the answer in any order.

Solution

C#

Python3

Don’t miss these tips!

We don’t spam! Read our privacy policy for more info.

Open chat
Powered by