汪小祯

做什么都是因为喜欢

268. Missing Number

题目Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array. For example,Given nums = [0, 1..


349. Intersection of Two Arrays

题目Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note:Each elemen..


383. Ransom Note

题目 Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the..


453. Minimum Moves to Equal Array Elements

题目Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementin..


389. Find the Difference

题目Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter..


448. Find All Numbers Disappeared in an Array

题目Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1,..


476. Number Complement

题目Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note:The given i..


463. Island Perimeter

题目You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontall..