public class Solution {

public int[] twoSum(int[] nums, int target) {

if (nums == null) return null;

int[] result = new int[]{};

for(int i=0,le=nums.length-1;i<le;i++){

int size = i+1;

while(size<=le){

if(nums[i]+nums[size]==target){

return result = new int[]{nums[i],nums[size]};

}

size ++;

}

}

return result;

}

}