- Jan 30 Mon 2017 21:45
231. Power of Two
- Jan 30 Mon 2017 21:29
326. Power of Three
- Jan 30 Mon 2017 20:12
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.
題意
- Jan 30 Mon 2017 17:49
415. Add Strings
Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2.
題意
- Jan 27 Fri 2017 15:53
136. Single Number
Given an array of integers, every element appears twice except for one. Find the single one.
Note:
- Jan 27 Fri 2017 14:29
292. Nim Game
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones.
Both of you are very clever and have optimal stratgies for the game. Write a function to determine whether you can win the game given the number of stones in the heap.
- Jan 24 Tue 2017 13:53
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, n] inclusive that do not appear in this array.
- Jan 20 Fri 2017 14:19
463. Island Perimeter Add to List QuestionEditorial Solution
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 horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells).
- Jan 20 Fri 2017 13:44
344. Reverse String Add to List QuestionEditorial Solution
- Jan 19 Thu 2017 12:00
412. Fizz Buzz Add to List QuestionEditorial Solution
Write a program that outputs the string representation of numbers from 1 to n.
But for multiples of three it should ouput "Fizz" instead of the number and for the multiples of five output "Buzz". For numbers which are multiples of both three and five output 'FizzBuzz"