Note I cc: [EMAIL PROTECTED] Please do so also so the other tutors can follow the discussion.
Andrei Petre wrote: > the theory seems just like mine :) > > your way to implement it looks fine ( although it supports some > optimization :)) > > But: > > - i don't understand : > i = int(s) > where s = the test case input (= a LIST ??) s is a string > > you should summs up the elements of the list In the pursuit of performance I chose int(s) as being potentially a lot faster than looping over all the chars, applying int() to each and summing. > > - it's not very clear in your implementation what happens with the > case : "815". try it I get 15. However 875 gives a wrong answer! Turns out that if the rightmost digit is not 0 I must remove a 5 even if that is the rightmost digit! Even after fixing that I still get "wrong answer"! > > and in one of your posts, you said: > > >The evidence pointed to a character in the test data other than > 0123456789. > > >So I contrived a way to test for this and found that to be true. I don't > >know what the character is or which test case it is in but there is at > >least one bad character, and it is < chr(32) (i.e. a control character). > >i don't understand , in your > > i don't really understand that. you are trying to say that the tests > from the online judge are not "exactly good" ? Yes that's exactly what I'm saying. At least one test case has a non-decimal character. > -- Bob Gailer 919-636-4239 Chapel Hill, NC _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor