Re: [BangPypers] SPOJ: Kamil -> Code Golf

2009-11-14 Thread Shashwat Anand
I left it. Will try again someday, the quest for perfection or should I say 53 chars should last by then :) On Sun, Nov 15, 2009 at 11:58 AM, Abhishek Mishra wrote: > I tried a lot, I give up. But I noticed this, > > if 'foo'.count (sub, [start, end]) > allowed us to place a regexp in place of su

Re: [BangPypers] SPOJ: Kamil -> Code Golf

2009-11-14 Thread Abhishek Mishra
I tried a lot, I give up. But I noticed this, if 'foo'.count (sub, [start, end]) allowed us to place a regexp in place of sub, we could've shortened it. But unfortunately we need to import re and compile one before using. So achieving something like foo = 'FILIPEK' q=1;foo.gsub(/[DTFL]/){q*=2} p

[BangPypers] SPOJ: Kamil -> Code Golf

2009-11-13 Thread Shashwat Anand
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')" >