【问题】
Given n points
on a 2D plane, find the maximum number of points that lie on the same straight line.
【思路】
对每一个点,分别计算这个点和其他所有点构成的斜率,具有相同斜率最多的点所构成的直线,就是具有最多点的直线。
【代码】
class Point:
def __in...
分类:
编程语言 时间:
2014-06-25 19:34:29
阅读次数:
246
当eclipse中新导入的Java Project的时候,往往会碰到各种各样的问题,下面是个典型的问题:
Cannot find the class file for javax.servlet.ServletContext.
如何解决该问题:
方案1. Project---》Properties--》Libraries 中添加
Tomcat中的 serverle...
分类:
编程语言 时间:
2014-06-25 00:16:45
阅读次数:
314
团队建设总结fx O622
大的title 2
建设团队文化 2
办公环境(3s+树+湖)
3
每人一个办公室 3
弹性工作制 3
重大的决定公投体制 3
每年一个kid经验日 3
做自己想到做的事.. 3
One2one 3
灵活的规定 3
公共的gucywe 4
感谢队友的工作 4
欣赏队友的工作,不要挑刺,在完美的工作也有缺点..only find ...
分类:
其他好文 时间:
2014-06-24 23:55:50
阅读次数:
523
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using e...
分类:
其他好文 时间:
2014-06-24 23:30:08
阅读次数:
278
【题目】
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
You may not engage in multiple transactions at the same time (i...
分类:
其他好文 时间:
2014-06-24 23:28:43
阅读次数:
223
1.Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in you
r Gemfile
2.ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/local/lib/ruby/gems/1.9.1 director.y
3.rails 3遇到 Could n...
分类:
其他好文 时间:
2014-06-24 22:18:45
阅读次数:
316
【题目】
Given a binary tree, find the maximum path sum.
The path may start and end at any node in the tree.
For example:
Given the below binary tree,
1
/ 2 3
Return 6.
【题意】
给定一棵二叉树,找出其中路径和最大的路径,然会返回最大路径和。
本题中的路径不是从根节点到叶子节点这样的传统的路...
分类:
其他好文 时间:
2014-06-24 20:42:59
阅读次数:
268
【题目】
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times). H...
分类:
其他好文 时间:
2014-06-24 19:40:53
阅读次数:
240
题目
Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and there exists one unique longest palindromic substring.
方法
...
分类:
其他好文 时间:
2014-06-24 19:36:55
阅读次数:
212
The world is beautiful. Even if you’re full of tears and sadness, open your eyes. Do what you want to do. Be what you want to be. Find friends. Don’t....
分类:
其他好文 时间:
2014-06-24 14:47:06
阅读次数:
295