汪小祯

做什么都是因为喜欢

405. Convert a Number to Hexadecimal

题目Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used. Note: All letters in hex..


415. Add Strings

题目Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length of both num1 and num2 is &l..


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,..