9.21 Study Recap

2.5 hours today on ONE PROBLEM.


It has actually been kind of fun, and it is a big enough problem that I wasn’t totally able to architect it mentally before starting. It is making change like a cashier would. I was able to use some of the same approaches from the previous roman numeral problem.

One thing I’m running into is that I have a function that is passed an array. I want to make a copy of that array so that I can compare the modified original array to the copy after some time. Nothing that I have been able to do prevents the copy from being a ‘clone’ of the original and having the same changes applied to it.

newArray= inputArray // this is not an independent array

newArray= inputArray.slice(0) //this should be independent

I’ve learned a bunch about how this should work (and I’ve got a phone-a-friend email waiting for a response) but I’ll be pretty happy when I can check off this box and be done with it.

Tell me what you think.

This site uses Akismet to reduce spam. Learn how your comment data is processed.