Created
February 10, 2012 21:26
-
-
Save lfranchi/1793004 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mostfreq = 2520 | |
| l = [] | |
| for i in range(1, 901): | |
| l.append(mostfreq/i) | |
| total = sum(l) | |
| print l, " of length: ", len(l) | |
| print "Total num of words is: %s and half is %s" % (total, total/2) | |
| cur = 0 | |
| for i in range(1, len(l) + 1): | |
| cur += l[i-1] | |
| print "Checking unique word num: %s, current total is: %s" % (i, cur) | |
| if cur >= total/2: | |
| print "Got Half: %s" % i | |
| break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment