摘要:
1 package singlenumber136; 2 //Given an array of integers, every element appears twice except for one. Find that single one. 3 //Your algorithm should have a linear runtime complexity. Could you i... 阅读全文
摘要:
1 package plusOne66; 2 /* 3 Given a non-negative number represented as an array of digits, plus one to the number. 4 The digits are stored such that the most significant digit is at the h... 阅读全文
摘要:
1 package myAtoi8; 2 /* 3 * Implement atoi to convert a string to an integer. 4 Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourse... 阅读全文
摘要:
1 package isUgly263; 2 /* 3 * Write a program to check whether a given number is an ugly number. 4 5 Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6,... 阅读全文
摘要:
1 package isPowerOfThree326; 2 /* 3 Given an integer, write a function to determine if it is a power of three. 4 */ 5 public class Solution { 6 /* 7 //题目理解错误,理解成3次开方 8 public st... 阅读全文
摘要:
1 package isHappy202; 2 /* 3 * Write an algorithm to determine if a number is "happy". 4 A happy number is a number defined by the following process: 5 Starting with any positive integer, repl... 阅读全文
摘要:
1 package countPrimes204; 2 /* 3 * Description: 4 * Count the number of prime numbers less than a non-negative number, n. 5 */ 6 public class Solution { 7 //Time Limit Exceeded 8 ... 阅读全文
摘要:
package addBinary67;/* Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100". */public class Solut 阅读全文