Monthly Archives: February 2016
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 does not represent a decimal point and is used to separate number sequences. Continue reading
Reverse Linked List
Reverse a singly linked list.
A linked list can be reversed either iteratively or recursively. Could you implement both?
Subscribe to see which companies asked this question. Continue reading
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
Write a bash script to calculate the frequency of each word in a text file
For simplicity sake, you may assume:
words.txtcontains only lowercase characters and space
Each word must consist of lowercase characters only.
Words are separated by one or more whitespace characters.