
leetcode
文章平均质量分 58
会开花的树-
永远要清楚现在要做什么
展开
-
leetcode--Max Points on a Line
程序调试到一点半才搞定····赶快分享出来!! 题目: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 思路: 用二维数组存储斜率······# Definition for a point# class Point:# def原创 2015-04-04 01:35:51 · 432 阅读 · 0 评论 -
Leetcode--两道简单的二进制问题
Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary r原创 2015-04-06 21:36:53 · 601 阅读 · 0 评论 -
leetcode--Contains Duplicate
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is原创 2015-05-29 00:12:45 · 357 阅读 · 0 评论 -
leetcode--House Robber
leetcode原创 2015-04-03 15:29:44 · 377 阅读 · 0 评论 -
leetcode--Summary Ranges
题目: Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return [“0->2”,”4->5”,”7”]. 描述: 给出一个没有重复值的排序好的整数数组,返回它的取值范围的集合. 例如:给出[0,1,2,原创 2015-06-26 16:42:59 · 529 阅读 · 0 评论