两数之和
class Solution { public int[] twoSum(int[] nums, int target) { StringBuilder sb = new StringBuilder(); for(int a:nums){ sb.append(a+""); } String s = sb.toString(); for(int i =0 ;i<nums.length;i++){ int tmp = target - nums[i]; if(s.contains(tmp+"")){ for(int j=0;j<nums.length;j++){ if(nums[j]==tmp){ return new int[]{i,j}; } } } } return null; } }