摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
QuestionGiven two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that ... 阅读全文
摘要:
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 ... 阅读全文