Skip to content

Dipin Krishna

I love to code. If you feel the same, then i have some cool codes for you. They are simple but good to get started.

  • Home
  • Blog
  • Privacy Policy
  • About
  • Contact
  • Home
  • Blog
  • Privacy Policy
  • About
  • Contact

Tag Archives: Two Sum

Home/Posts Tagged: Two Sum
python

Python: Two Sum Problem

Sep 28, 2018Dipin KrishnaCoding, PythonPython, Python 3, Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target. The below python code will return the first solution found, and assumes that no element appears twice. def twoSum(nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ index_map = {} for i

Read More

Search

Theme by Think Up Themes Ltd. Powered by WordPress.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok