This kata is taken from the 2019 BattleDev we've done. It was the 4th/6 exercise, so expect it to be difficult.
You are Aladdin, and just fell into the cave of wonders.
Well, you're quite damn happy about what you see, but the only thing you've got on yourself is your magic lamp.
You magic lamp has a limited capacity of Xg. You can see objects (gems, carpets, gold pieces...) of a certain weight and a fixed price (for 1 object). There's also powders with a certain quantity in g and a ppg (price per g).
You must complete the function fillTheLampToBeTheRichestManInTheWorld(maxCapacity, objects, powders) to go out of the cave with the maximum value you can carry (well it's your lamp that's carrying it, but you'll be the richest man in the world).
In the src folder, you will find index.js with the function ready to be implemented.
You can use npm run test to test your code. If all tests pass, you won !
But first intall the dependencies with npm install. Thanks.
PS : the last test is the hard part. If you don't pass it, you have implemented the method fillTheLampToAlmostBeTheRichestManInTheWorld(), but your still rich so you can be satisfied. If your more of an Uncle Scrooge, complete the last test !
That's it, there's nothing else to say.
Have fun solving this problem.