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

leetcode:Palindrome Number【Python版】

一次AC 题目要求中有空间限制,因此没有采用字符串由量变向中间逐个对比的方法,而是采用计算翻转之后的数字与x是否相等的方法; 1 class Solution: 2 # @return a boolean 3 def isPalindrome(self, x): 4 o = x 5 ret = 0 6 flag = ...

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

leetCode 179. Largest Number 字符串排序 | Medium | lambda表达式

179. Largest Number Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. No...

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

Leetcode 447. Number of Boomerangs JAVA语言

1 2 3 4 Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i,&nbs...

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

Leetcode 476. Number ComplementJAVA语言

1 2 3 4 5 6 7 8 9 10 Given a positive integer, output its complement number. The complement strategy is to flip the bits ...

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

Leetcode264. Ugly Number II JAVA语言

1 2 3 Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only incl...

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

Leetcode 263. Ugly Number JAVA语言

1 2 3 Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose&nb...

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

Leetcode 137. Single Number II JAVA语言

1 2 3 Given an array of integers, every element appears three times except for one, which appears exactly once. Fin...

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

Leetcode 260. Single Number III JAVA语言

1 2 3 4 5 6 Given an array of numbers nums, in which exactly two elements appear only once and all the other e...

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

leetcode 452. Minimum Number of Arrows to Burst Balloons

1 2 3 4 5 There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is&...

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

[LeetCode] Valid Triangle Number 合法的三角形个数

Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle. Example 1: ....

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

算法编程

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

+关注