Easy Come Easy Go
求两个日期间相隔的天数
这两天在网上看到了一道求两个日期间相隔天数的题目,想到了一个实现的方法:
import time time1 = raw_input("Please input time1:") time2 = raw_input("Please input time2:") timeStamp1 = int(time.mktime(time.strptime(time1,"%Y-%m-%d"))) timeStamp2 = int(time.mktime(time.strptime(time2,"%Y-%m-%d"))) diff = abs(timeStamp1 - timeStamp2) print diff/24/60/60
观诸兵书 无出孙武
天才在左 疯子在右
在每个人的内心深处,都有一种叛逆。
也许他们是疯子,但是他们做到了我们未曾做到的事,他们是独特的,唯一的,没人敢说天才不是疯子,疯子不是天才。
I merely wanna install numpy for windows without VC
I go home with my surface in this hoilday.it’s convenient because his simplification.
Howover,that is all why i am sad today.
Compare Version Numbers
Compare two version numbers version1 and version2.
If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0.
You may assume that the version strings are non-empty and contain only digits and the .
character.
The .
character does not represent a decimal point and is used to separate number sequences. Continue reading
Reverse Linked List
Reverse a singly linked list.
Hint:
A linked list can be reversed either iteratively or recursively. Could you implement both?
Subscribe to see which companies asked this question. Continue reading
Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Subscribe to see which companies asked this question Continue reading
Word Frequency
Write a bash script to calculate the frequency of each word in a text file words.txt
.
For simplicity sake, you may assume:
-
words.txt
contains only lowercase characters and space' '
characters. -
Each word must consist of lowercase characters only.
-
Words are separated by one or more whitespace characters.