LeetCode - Missing Number

LeetCode 的 Missing Number 題目如下: Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array. ...

February 29, 2016 · 1 min · 264 words · Larry Nung

LeetCode - Move Zeroes

LeetCode 的 Move Zeroes 題目如下: 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. ...

February 28, 2016 · 1 min · 236 words · Larry Nung

LeetCode - Number of 1 Bits

LeetCode 的 Number of 1 Bits 題目如下: Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hamming weight). ...

February 24, 2016 · 1 min · 172 words · Larry Nung

LeetCode - Power of Three

LeetCode 的 Power of Three 題目如下: Given an integer, write a function to determine if it is a power of three. ...

February 18, 2016 · 1 min · 166 words · Larry Nung

LeetCode - Add Digits

LeetCode 的 Add Digits 題目如下: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. ...

February 10, 2016 · 1 min · 266 words · Larry Nung

LeetCode - Happy Number

LeetCode 的 Happy Number 題目如下: Write an algorithm to determine if a number is “happy”. ...

September 18, 2015 · 1 min · 282 words · Larry Nung

LeetCode - Roman to Integer

LeetCode 的 Roman to Integer 題目如下: Given a roman numeral, convert it to an integer. ...

September 11, 2015 · 1 min · 447 words · Larry Nung

LeetCode - Length of Last Word

LeetCode 的 Length of Last Word 題目如下: Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string. ...

September 11, 2015 · 1 min · 219 words · Larry Nung

LeetCode - Power of Two

LeetCode 的 Power of Two 題目如下: Given an integer, write a function to determine if it is a power of two. ...

August 23, 2015 · 1 min · 303 words · Larry Nung

LeetCode - Valid Anagram

LeetCode 的 Valid Anagram 題目如下: Given two strings s and t, write a function to determine if t is an anagram of s. ...

August 15, 2015 · 1 min · 214 words · Larry Nung