ps2a (nuggets) - what is wrong with this coding? any help is appreciated http://codepad.org/KNWeo3ig
Few things: Lines 2 and 10 are pointless since you're working with a range in line 3. Your else block on line 11 is also improperly indented, so it runs at the end of the line 3 for loop every time, and only then. It's also unecessary, since you don't want to print every single time you fail to find a match, as you'll end up with thousands of print statements. http://codepad.org/BavNjClV I fixed the above and it seems to do what's expected of it.
kgiax, you beat me to it. Also, you can optimize your code a bit. For example, for 'a' you don't need to search from 0 to n, but rather from 0 to n/6 + 1.
and by search, I meant iterate through...
Join our real-time social learning platform and learn together with your friends!