Tag: python
July 1, 2012
algorithms, beginner, code, code library, implementation, interview questions, math, programming languages, python, technical
GCD (Greatest Common Divisor), in mathematics, is refered to the largest number that divides two or more non-zero integers without a remainder. For example, the GCD of 8 and …
The problem is from codeforces: http://codeforces.com/problemset/problem/180/C Let n be the number of lower-cases that have encountered so far from left to right; So everytime there is an uppercase letter, …
The problem is from codeforces http://codeforces.com/problemset/problem/2/A To solve this problem, you will probably need to know the dictionary. In Python, the dictionary structure can be declared using notation {}. …
The full permutation of a list can be easily programmed using recursive algorithms. The number of the full permutation results is where is the number of elements to permutate. …
Creating threads is very easy in Python. The following is the example that I use to demonstrate the multithreading in Python. #!/usr/bin/env python import threading import time # lock …