Re: Python Programming Challenges for beginners?

2009-12-01 Thread Jon Clements
On Nov 30, 9:13 pm, f...@mauve.rahul.net (Edward A. Falk) wrote: > In article <09ea817f-57a9-44a6-b815-299ae3ce7...@x5g2000prf.googlegroups.com>, > > alex23   wrote: > >On Nov 27, 1:24 pm, astral orange <457r0...@gmail.com> wrote: > >> I would like to test out what I know so far by solving programm

Re: Python Programming Challenges for beginners?

2009-11-30 Thread Edward A. Falk
In article <09ea817f-57a9-44a6-b815-299ae3ce7...@x5g2000prf.googlegroups.com>, alex23 wrote: >On Nov 27, 1:24 pm, astral orange <457r0...@gmail.com> wrote: >> I would like to test out what I know so far by solving programming >> challenges. > >Project Euler can be a lot of fun: http://projecteule

Re: Python Programming Challenges for beginners?

2009-11-28 Thread n00m
PS My straightforward C++ solution got TLE... #include #include #include #include #include #include #include #include #include using namespace std; int main() { //freopen("88.txt", "rt", stdin); //freopen("99.txt", "wt", stdout); int tcs; string s; cin >> tcs; whi

Re: Python Programming Challenges for beginners?

2009-11-28 Thread n00m
On Nov 28, 8:24 pm, Lie Ryan wrote: > Now, this makes me interested. How efficient it would be when len(s) == > 1... might as well write it and see. Take back what I said, give me > a minute... ... and you can check it here: http://www.spoj.pl/problems/DISUBSTR/ I see there only one (accepted

Re: Python Programming Challenges for beginners?

2009-11-28 Thread Lie Ryan
On 11/28/2009 1:51 AM, n00m wrote: On Nov 27, 1:22 pm, Jon Clements wrote: Of course, if you take '~' literally (len(s)<= -10001) I reckon you've got way too many :) Jon. Then better: len(s)< abs(~1) PS It's a hard problem; so let's leave it alone I'm not going to write it, but I gue

Re: Python Programming Challenges for beginners?

2009-11-27 Thread Someone Something
Codechef and all those algorithmic websites aren't very good for python because, quite frankly, python is definitley slower than C or C++. You should probably pick up a project on sourceforge or freshmeat if you feel confident enough. On Thu, Nov 26, 2009 at 10:24 PM, astral orange <457r0...@gmail

Re: Python Programming Challenges for beginners?

2009-11-27 Thread n00m
On Nov 27, 6:00 pm, Paul Rudin wrote: > efficiency ... This is it! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Challenges for beginners?

2009-11-27 Thread n00m
> abba > bbaz> abbaz > > == > > Answer: 11 > > Answer: 13- Hide quoted text - 14 ! with '' (empty substring :-)) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Challenges for beginners?

2009-11-27 Thread Paul Rudin
n00m writes: > On Nov 27, 1:22 pm, Jon Clements wrote: >> Of course, if you take '~' literally (len(s) <= -10001) I reckon >> you've got way too many :) >> >> Jon. > > Then better: len(s) < abs(~1) > > PS It's a hard problem; so let's leave it alone what's hard? substrings of a string? If y

Re: Python Programming Challenges for beginners?

2009-11-27 Thread MRAB
n00m wrote: On Nov 27, 5:24 am, astral orange <457r0...@gmail.com> wrote: [skip] How about the next problem: you are given string "s" (len(s) <= ~1), in the string only letters 'a'..'z' Task: to count the number of all *different* substrings of "s" Example: s = 'abbaz' Its different substri

Re: Python Programming Challenges for beginners?

2009-11-27 Thread J Kenneth King
astral orange <457r0...@gmail.com> writes: > Hi- > > I am reading the online tutorial along with a book I bought on Python. > I would like to test out what I know so far by solving programming > challenges. Similar to what O'Reilly Learning Perl has. I really > enjoyed the challenges at the end of

Re: Python Programming Challenges for beginners?

2009-11-27 Thread n00m
On Nov 27, 1:22 pm, Jon Clements wrote: > Of course, if you take '~' literally (len(s) <= -10001) I reckon > you've got way too many :) > > Jon. Then better: len(s) < abs(~1) PS It's a hard problem; so let's leave it alone -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Challenges for beginners?

2009-11-27 Thread Jon Clements
On Nov 27, 9:43 am, n00m wrote: > > You're missing some sub-strings. > > Yes! :) Of course, if you take '~' literally (len(s) <= -10001) I reckon you've got way too many :) Jon. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Challenges for beginners?

2009-11-27 Thread n00m
> You're missing some sub-strings. Yes! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Challenges for beginners?

2009-11-27 Thread John McMonagle
n00m wrote: > On Nov 27, 5:24 am, astral orange <457r0...@gmail.com> wrote: > [skip] > > How about the next problem: > you are given string "s" (len(s) <= ~1), in the string only > letters 'a'..'z' > Task: to count the number of all *different* substrings of "s" > > Example: > s = 'abbaz' > I

Re: Python Programming Challenges for beginners?

2009-11-27 Thread Wolodja Wentland
On Thu, Nov 26, 2009 at 19:24 -0800, astral orange wrote: > Hi- > > I am reading the online tutorial along with a book I bought on Python. > I would like to test out what I know so far by solving programming > challenges. Similar to what O'Reilly Learning Perl has. I really > enjoyed the challenge

Re: Python Programming Challenges for beginners?

2009-11-26 Thread n00m
On Nov 27, 5:24 am, astral orange <457r0...@gmail.com> wrote: [skip] How about the next problem: you are given string "s" (len(s) <= ~1), in the string only letters 'a'..'z' Task: to count the number of all *different* substrings of "s" Example: s = 'abbaz' Its different substrings are: a b z

Re: Python Programming Challenges for beginners?

2009-11-26 Thread alex23
On Nov 27, 1:24 pm, astral orange <457r0...@gmail.com> wrote: > I would like to test out what I know so far by solving programming > challenges. Project Euler can be a lot of fun: http://projecteuler.net/ -- http://mail.python.org/mailman/listinfo/python-list

Python Programming Challenges for beginners?

2009-11-26 Thread astral orange
Hi- I am reading the online tutorial along with a book I bought on Python. I would like to test out what I know so far by solving programming challenges. Similar to what O'Reilly Learning Perl has. I really enjoyed the challenges at the end of the chapter and it really help me test out if I was tr