Leetcode Problem:- https://leetcode.com/problems/two-sum/

Let’s start understand the problem,

Here, we have to find the indices of two numbers from given array in which sum of that two number should be equal to target number that given in function argument.

Here, I thought, easiest solution is we have to just find numbers whose sum is equal to target number. So, first idea click on my brain is:

target number = first number + second number

but here problem is that numbers could be from any indices. So, second idea strike to my brain is:

target number = array[i] + array[j]

Prerequisite:- Make sure that you have java development kit(JDK) installed and configured.

Step 1) Go to Google and search as https://tomcat.apache.org/download-80.cgi

Step 2) Click on “32-bit/ 64-bit Windows Service Installer(pgp, sha512)”.

Akash Tawade

I am enthusiastic senior software developer , I am working on java as well as latest DevOps technologies. My hobbies are reading books and making memes.

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