Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

I've just made a solution for ps4 problems and according to the test cases given, it is correct, but I want to compare it with other people solutions so I'm posting mine here and I'll wait for some of you to do the same if you'd please :) [forgive me for any english language issues 'cause I don't live in a english-speaking country]

MIT 6.00 Intro Computer Science (OCW)
See more answers at
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly


Get your free account and access expert answers to this and thousands of other questions

I forgot the code, here it is:
I'll post mine up later because it is saved on the other computer, I don't have access right now. I'm interested too, as I didn't give mine an aggressive testing, so be warned it could be wrong. okay that's mine.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Thanks! I was looking for a different style of thinking the problem and that's exactly what I found in your solution =)
This is mine: ManuStarlight, our solutions for problem 4 are very similar. Joz, I think you forgot that your variable maxExpenses should have value of savings, which you can get from your function postRetirement() You wrote: maxExpenses = 200000
Ah yes, you are right. I just put an arbitrary upperbound which I thought would be quite high and so not fail. Very interesting to go back and look, there are a number of things that I can improve upon here in my code.
Wow, the importance of comments.... I just ran my test, and it didn't work out... I forgot that when I wrote it I changed a bunch just to see if it ran. But I didn't comment, and I just left "should equal 1229....) I just spent time debugging a non-problem...
Cool, I have improved my program a lot with thanks to both. assert statements, abs, maxExpenses, and generally making it more consise...
Now it's look very good, with all that comments.

Not the answer you are looking for?

Search for more explanations.

Ask your own question