摘要:
[题目] Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. [题目解析] 这道题很关键的是要理解罗马数字的几个主要的代表符号和表示方式 阅读全文
摘要:
[题目]Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. [题目解析] 这是对于求两 阅读全文
摘要:
[题目] 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 阅读全文
摘要:
[题目] 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 阅读全文