题目:It can be seen that the number, 125874, and its double, 251748, contains exactly the same digits, but in a different order. Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, ...
分类:
编程语言 时间:
2015-07-09 13:20:06
阅读次数:
158
题目:
Write a function to find the longest common prefix string amongst an array of strings.
题意:
写出一个函数,找到一组数组中的最长公共子串。
算法分析:
需要构建两重循环。第一层是最短子串的长度,另一层是遍历字符串数组中的每个成员。
brute force的想法,以第一个字符串为标准,对于...
分类:
编程语言 时间:
2015-07-09 13:17:56
阅读次数:
138
这道题与033 Search in Rotated Sorted Array基本思路一样, 也是比较最左边和中间的值的差别,唯一要注意的是 当a[left] < a[mid]的时候需要将a[left] 加入到右半部分一起考虑,因为有可能a[left] 就是最小值class Solution: ...
分类:
其他好文 时间:
2015-07-09 13:11:33
阅读次数:
152
Maximal SquareGiven a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the ...
分类:
其他好文 时间:
2015-07-09 12:41:13
阅读次数:
103
Digit factorials
Problem 34
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.Find the sum of all numbers which are equal to the sum of the factorial of their digits.Note: as 1! = 1 and 2...
分类:
其他好文 时间:
2015-07-09 00:50:46
阅读次数:
166
最近学了ZF框架,对手册中DB这一节Zend_Db_Table_Row的介绍中说,使用了Zend_Db_Table::find()或::findRow()方法可以返回一个Zend_Db_Table_Row的对象,该对象自动映射到表中的这一行记录,字段和类属性完全关联在一起(字段名是下划线分隔的,.....
分类:
其他好文 时间:
2015-07-09 00:38:26
阅读次数:
349
>>> from selenium.webdriver.common.action_chains import ActionChains>>> setting = driver.find_element_by_xpath("//div[@id='u1']/a[7]")>>> ActionChains...
分类:
其他好文 时间:
2015-07-09 00:36:53
阅读次数:
88
Question:Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.No...
分类:
其他好文 时间:
2015-07-08 22:23:17
阅读次数:
111
首先cmd切换到android-sdk-windows\tools\lib,找到find_java.bat 打开回显:rem @echo off,再运行find_java.bat,若输出的set java_exe=同jdk安装路径不符,则需要检查环境变量JAVA_HOME和PATH中java.exe...
分类:
其他好文 时间:
2015-07-08 22:18:05
阅读次数:
150
Majority Element IIGiven an integer array of sizen, find all elements that appear more than? n/3 ?times. The algorithm should run in linear time and i...
分类:
其他好文 时间:
2015-07-08 20:28:29
阅读次数:
103