文章 2017-12-02 来自:开发者社区

[LeetCode] Happy Number 快乐数

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 integer, replace the number by the sum of the squares o....

文章 2017-12-02 来自:开发者社区

[LeetCode] Letter Combinations of a Phone Number 电话号码的字母组合

Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string ".....

文章 2017-12-02 来自:开发者社区

[LeetCode] Number of Digit One 数字1的个数

Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. For example: Given n = 13, Return 6, because digit 1 occurred in the following nu....

文章 2017-12-01 来自:开发者社区

[LeetCode] Single Number III 单独的数字之三

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. For example: Given&nbs...

文章 2017-12-01 来自:开发者社区

[LeetCode] Ugly Number 丑陋数

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 example, 6, 8 are ugly while 14&n...

文章 2017-12-01 来自:开发者社区

[LeetCode] Ugly Number II 丑陋数之二

Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequenc...

文章 2017-12-01 来自:开发者社区

[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. For example, Given nums = [0, 1, 3] return ...

文章 2017-11-16 来自:开发者社区

Leetcode:Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer to string, note t....

文章 2017-11-16 来自:开发者社区

LeetCode:Letter Combinations of a Phone Number

题目链接 Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit str.....

文章 2017-11-14 来自:开发者社区

leetCode 202. Happy Number 哈希

202. Happy Number 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 integer, replace the number by the s.....

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

算法编程

开发者社区在线编程频道官方技术圈。包含算法资源更新,周赛动态,每日一题互动。

+关注