[BangPypers] SPOJ: Kamil -> Code Golf

Shashwat Anand anand.shashwat at gmail.com
Fri Nov 13 23:31:46 CET 2009


I was doing a problem KAMIL : https://www.spoj.pl/problems/KAMIL/ and the
shortest version i came up with was :

>>> for i in range(10):t=raw_input();print 2**sum(t.count(i)for i in'DFLT')
This is 71 character long.
>>> s = "for i in range(10):t=raw_input();print 2**sum(t.count(i)for i
in'DFLT')"
>>> len(s)
71
However the best solutions in python (
https://www.spoj.pl/ranks/KAMIL/lang=PYTH%202.5 ) shows that it can be
reduced to 53 character long. Do anyone here had solved this problem or have
an idea as to  how to shorten the code any more ? I'm still clueless.


More information about the BangPypers mailing list