Posts: 144 Location: Finland Joined: 08.08.06 Rank: Newbie
Posted on 14-09-08 11:57
final += final[i]?
I understand pseudo code, but that isn't correct, unless they mean append or something, and I don't want to waste my time.
IMO you're right. There is actually an error in the pseudo code.
FOR i = 0; i < str.length; i++
final += final[i]
final += final[i+2]
final += final
In the line where it says final += final[i] the final[i] would be null, because the final is a nonexistent variable at this point. It should actually say final += str[i], because str is the variable referred to on the first line. I believe str in this case refers to the string given in the challenge. Same goes for the next ones too (final[i+2] and final). On the last line the final variable would still be null.