摘要: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文
posted @ 2018-03-03 06:59 轻风舞动 阅读(1861) 评论(0) 推荐(0) 编辑
摘要: Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the thr 阅读全文
posted @ 2018-03-03 04:41 轻风舞动 阅读(325) 评论(0) 推荐(0) 编辑
摘要: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s 阅读全文
posted @ 2018-03-03 04:26 轻风舞动 阅读(412) 评论(0) 推荐(0) 编辑
摘要: Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the or 阅读全文
posted @ 2018-03-03 03:10 轻风舞动 阅读(545) 评论(0) 推荐(0) 编辑
摘要: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, just two one's 阅读全文
posted @ 2018-03-02 14:54 轻风舞动 阅读(388) 评论(0) 推荐(0) 编辑
摘要: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, just two one's 阅读全文
posted @ 2018-03-02 14:51 轻风舞动 阅读(564) 评论(0) 推荐(0) 编辑
摘要: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below 阅读全文
posted @ 2018-03-02 14:29 轻风舞动 阅读(371) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2: Example 3: 阅读全文
posted @ 2018-03-02 14:22 轻风舞动 阅读(705) 评论(0) 推荐(0) 编辑
摘要: Suppose we abstract our file system by a string in the following manner: The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents: The director 阅读全文
posted @ 2018-03-02 08:43 轻风舞动 阅读(628) 评论(0) 推荐(0) 编辑
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2018-03-02 08:28 轻风舞动 阅读(429) 评论(0) 推荐(0) 编辑