Challenge No1

Challenge No1

Postby Yoriz » Wed Jun 05, 2013 7:39 pm

Difficulty - Hard

Actually stick to getting on with some coding / learning rather then browsing the net / watching tv / playing games ect.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 842
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: Challenge No1

Postby metulburr » Wed Jun 05, 2013 7:51 pm

Image
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1472
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Challenge No1

Postby Yoriz » Wed Jun 05, 2013 7:56 pm

That looks quite acurate apart from the 20% figuring out yesterdays code when its quite likely that you didnt actually manage to write any code yesterday, you put it off for the next day.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 842
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: Challenge No1

Postby setrofim » Wed Jun 05, 2013 9:46 pm

Yoriz wrote:That looks quite acurate apart from the 20% figuring out yesterdays code when its quite likely that you didnt actually manage to write any code yesterday, you put it off for the next day.

Well, according to the chart, you spend 2% of you time writing "productive code". So the 11% of the time today is spent figuring out what you did the 2% of the time yesterday.
setrofim
 
Posts: 288
Joined: Mon Mar 04, 2013 7:52 pm

Re: Challenge No1

Postby XndrK » Wed Jan 29, 2014 7:36 pm

I want a new challenge!
Proverbs 26:14 describes me a bit too well.

Version: Python 2.7.5

https://github.com/4of92000
https://github.com/PythonForum/
User avatar
XndrK
 
Posts: 172
Joined: Sat Jun 15, 2013 7:57 pm

Re: Challenge No1

Postby micseydel » Wed Jan 29, 2014 7:40 pm

Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1371
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: Challenge No1

Postby Mekire » Thu Jan 30, 2014 9:38 am

I dun think its fast enuf :?

Code: Select all
import itertools


def has_subset_sum(seq, n=0):
    all_subsets = (itertools.combinations(seq, i) for i in range(1, len(seq)+1))
    return n in (sum(subset) for subsets in all_subsets for subset in subsets)


if __name__ == "__main__":
    test_sequence = {-7, 22, -3, -2, 17, 4, -39}
    print(has_subset_sum(test_sequence))

Halp?
-Mek

http://en.wikipedia.org/wiki/Subset_sum
User avatar
Mekire
 
Posts: 988
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan


Return to Challenges

Who is online

Users browsing this forum: No registered users and 0 guests

cron