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)”.