Jun 24 LeetCode #1 Two Sum

class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
for i in range(len(nums)):
for j in range(i + 1, len(nums)):
if nums[i] + nums[j] == target:
return [i, j]
https://towardsdatascience.com/big-o-d13a8b1068c8

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
pika

pika

Interested in Philo Film Reading | HK to SF | HongKongers | SAVEHONG12YOUTHS | Free Hong Kong | A programming beginner | An enthusiast to teach Computer Science