摘要: Problem: Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Each elemen 阅读全文
posted @ 2016-10-30 11:51 SillyVicky 阅读(203) 评论(0) 推荐(0)
摘要: Problem: Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. Each ele 阅读全文
posted @ 2016-10-30 11:49 SillyVicky 阅读(382) 评论(0) 推荐(0)
摘要: Problem: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice i 阅读全文
posted @ 2016-10-30 01:25 SillyVicky 阅读(173) 评论(0) 推荐(0)
摘要: Problem: 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 阅读全文
posted @ 2016-10-30 01:12 SillyVicky 阅读(247) 评论(0) 推荐(0)
摘要: Problem: Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = " 阅读全文
posted @ 2016-10-29 01:20 SillyVicky 阅读(205) 评论(0) 推荐(0)
摘要: Problem: Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1. Examples: Summary: 找到字符串中第 阅读全文
posted @ 2016-10-28 23:54 SillyVicky 阅读(148) 评论(0) 推荐(0)
摘要: Problem: Given a column title as appear in an Excel sheet, return its corresponding column number. For example: Summary: 将二十六进制数字转为十进制。 Analysis: 阅读全文
posted @ 2016-10-27 12:41 SillyVicky 阅读(130) 评论(0) 推荐(0)
摘要: Problem: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally id 阅读全文
posted @ 2016-10-27 11:41 SillyVicky 阅读(216) 评论(0) 推荐(0)
摘要: Problem: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For exa 阅读全文
posted @ 2016-10-26 11:54 SillyVicky 阅读(135) 评论(0) 推荐(0)
摘要: Problem: Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if 阅读全文
posted @ 2016-10-26 11:41 SillyVicky 阅读(210) 评论(0) 推荐(0)