摘要: Given an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and the d... 阅读全文
posted @ 2015-06-08 23:37 huj690 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr... 阅读全文
posted @ 2015-06-08 23:27 huj690 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked list.思路:to slove this problem, I choose a recurrent method, to reverse linked-list nodes one-by-one.first, point head to NULL.... 阅读全文
posted @ 2015-06-08 23:21 huj690 阅读(297) 评论(0) 推荐(0) 编辑
摘要: Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文
posted @ 2015-06-08 22:16 huj690 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary tree every level, except... 阅读全文
posted @ 2015-06-08 21:30 huj690 阅读(304) 评论(0) 推荐(0) 编辑
摘要: Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right corner as shown ... 阅读全文
posted @ 2015-06-08 15:16 huj690 阅读(294) 评论(0) 推荐(0) 编辑