I felt like doing an algorithm and found this problem on leetcode
Given an array of integers, find two numbers such that they add up to a specific target num
As @Prayer mentioned above, here is the accepted answer.
class Solution { public int[] twoSum(int[] nums, int target) { int[] resultarray=new int[2]; for (int i=0;i