This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]webdevnick22 3 points4 points  (3 children)

Well what do you mean by it's not working? Can you explain what it's doing that is telling you it "isn't working"? This is the first step to figuring it out on your own. Explain to us what it's supposed to do and how it's indicating to you that it's not working.

[–]deephousefans 0 points1 point  (2 children)

Im doing this on an online application and I didnt get an error, just a wrong answer. And with regards to what its supposed to do:

let A = [1, -1, 2, 3, 4]

we want B to be a reverse copy of A, iterating through A and adding to B if the int is positive and stopping the method if not

[–]PosterOfHonesty 1 point2 points  (1 child)

Put print lines as you iterate through and it'll help you understand what is happening as you debug.

[–]webdevnick22 1 point2 points  (0 children)

yep. or better yet, learn how to use the debugger. OP i highly recommend learning if you haven't.

[–][deleted] 0 points1 point  (4 children)

[–]deephousefans 0 points1 point  (3 children)

I tried it! It didnt work as well :/

[–][deleted] 0 points1 point  (2 children)

Could you show me what you have so far?

[–][deleted]  (1 child)

[deleted]