01 2018 档案
摘要:Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: 题意:给定以字符串形式表示的两个非负整数num1和num2,返回这两个整数的和。No
阅读全文
摘要:Given an m * n matrix M initialized with all 0's and several update operations. Operations are represented by a 2D array, and each operation is repres
阅读全文
摘要:You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find the total number
阅读全文
摘要:A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128
阅读全文
摘要:Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note:n is positive and will fit within the range of a 32-bi
阅读全文
摘要:Given an integer, write a function to determine if it is a power of three. Follow up:Could you do it without using any loop / recursion? Credits:Speci
阅读全文
摘要:Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For exa
阅读全文
摘要:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like:
阅读全文
摘要:Given an integer, write a function to determine if it is a power of two. Credits:Special thanks to @jianchao.li.fighter for adding this problem and cr
阅读全文
摘要:Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege
阅读全文