scala。。我太难了
object Solution {
def twoSum(nums: Array[Int], target: Int): Array[Int] = {
var res: Array[Int] = new Array[Int](2);
val len = nums.length;
for( i <- 0 to len-2 ; j <- i+1 to len-1 ){
if(nums(i) + nums(j) == target){
res(0) = i;
res(1) = j;
}
}
return res;
}
}