摘要:
QuestionGiven a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant dig... 阅读全文
posted @ 2015-09-11 04:24
树獭君
阅读(171)
评论(0)
推荐(0)
摘要:
QuestionGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in... 阅读全文
posted @ 2015-09-11 04:03
树獭君
阅读(146)
评论(0)
推荐(0)
摘要:
QuestionGiven two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that ... 阅读全文
posted @ 2015-09-11 03:53
树獭君
阅读(189)
评论(0)
推荐(0)
摘要:
Solution 1Naive wayFirst, sort the array using Arrays.sort in Java. Than, scan once to find the majority element. Time complexity O(nlog(n)) 1 public ... 阅读全文
posted @ 2015-09-11 03:07
树獭君
阅读(170)
评论(0)
推荐(0)

浙公网安备 33010602011771号