摘要: Question: Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Example 1: 阅读全文
posted @ 2017-04-24 19:43 SapphireCastle 阅读(76) 评论(0) 推荐(0) 编辑
摘要: Question: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and 阅读全文
posted @ 2017-04-24 19:38 SapphireCastle 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Question: Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of 阅读全文
posted @ 2017-04-24 17:50 SapphireCastle 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Question: Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image be 阅读全文
posted @ 2017-04-24 17:41 SapphireCastle 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Question: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which mak 阅读全文
posted @ 2017-04-24 17:34 SapphireCastle 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Question: 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 阅读全文
posted @ 2017-04-25 07:01 SapphireCastle 阅读(74) 评论(0) 推荐(0) 编辑
摘要: Question: Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runt 阅读全文
posted @ 2017-04-24 23:57 SapphireCastle 阅读(68) 评论(0) 推荐(0) 编辑
摘要: Question: Given a binary array, find the maximum number of consecutive 1s in this array. Solution: 题目直达:https://leetcode.com/problems/max-consecutive- 阅读全文
posted @ 2017-04-24 23:43 SapphireCastle 阅读(89) 评论(0) 推荐(0) 编辑
摘要: Question: 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 horiz 阅读全文
posted @ 2017-04-24 23:42 SapphireCastle 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Question: You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers 阅读全文
posted @ 2017-04-24 22:51 SapphireCastle 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Question: Write a function that takes a string as input and returns the string reversed. Example 1: Note: Solution: 题目直达:https://leetcode.com/problems 阅读全文
posted @ 2017-04-24 17:54 SapphireCastle 阅读(80) 评论(0) 推荐(0) 编辑