上一页 1 ··· 18 19 20 21 22
摘要: 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 树獭君 阅读(165) 评论(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 树獭君 阅读(137) 评论(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 树獭君 阅读(183) 评论(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 树獭君 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Question:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of t... 阅读全文
posted @ 2015-09-01 10:52 树獭君 阅读(215) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22