摘要: [题目] Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. [题目解析] 这道题很关键的是要理解罗马数字的几个主要的代表符号和表示方式 阅读全文
posted @ 2016-08-18 22:27 三刀 阅读(91) 评论(0) 推荐(0) 编辑
摘要: [题目]Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. [题目解析] 这是对于求两 阅读全文
posted @ 2016-08-18 22:19 三刀 阅读(145) 评论(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 th 阅读全文
posted @ 2016-08-18 19:45 三刀 阅读(103) 评论(0) 推荐(0) 编辑
摘要: [题目] Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume tha 阅读全文
posted @ 2016-08-18 00:59 三刀 阅读(137) 评论(0) 推荐(0) 编辑