@@ -0,0 +1,867 @@
+package com.tuinsomniacorp.leetcode.easy;%0D%0A%0D%0A/**%0D%0A * Given an array of integers, return indices of the two numbers such that they%0D%0A * add up to a specific target. You may assume that each input would have%0D%0A * exactly one solution. Example: Given nums = %5B2, 7, 11, 15%5D, target = 9,%0D%0A * %0D%0A * Because nums%5B0%5D + nums%5B1%5D = 2 + 7 = 9, return %5B0, 1%5D.%0D%0A * %0D%0A * @author Angel Banuelos ing.angel.banuelos@gmail.com%0D%0A *%0D%0A */%0D%0Apublic class TwoSum %7B%0D%0A%0D%0A%09%0D%0A%09/**%0D%0A%09 * Cuadratic Solution %0D%0A%09 * @param nums%0D%0A%09 * @param target%0D%0A%09 * @return array with the solution%0D%0A%09 */%0D%0A%09public int%5B%5D twoSum(int%5B%5D nums, int target) %7B%0D%0A%09%09int%5B%5D result = new int%5B2%5D;%0D%0A%09%09%0D%0A%09%09for (int i = 0; i %3C nums.length; i++) %7B%0D%0A%09%09%09for(int j = i; j %3C nums.length; j++) %7B%0D%0A%09%09%09%09if(nums%5Bi%5D + nums%5Bj%5D == target)%7B%0D%0A%09%09%09%09%09result%5B0%5D = i;%0D%0A%09%09%09%09%09result%5B1%5D = j;%0D%0A%09%09%09%09%09return result;%0D%0A%09%09%09%09%7D%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09return result;%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

1 TwoSum, level: easy, Big(O) = N^2