solution#659
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because it meets the core functional requirements and the tests correctly exercise the getCoinCombination implementation for most key scenarios. Your tests cover declaration, zero, single-coin cases, and several mixed examples, and the implementation returns the correct minimal-coin breakdown with the expected [pennies, nickels, dimes, quarters] ordering. The only gap is that the explicit example getCoinCombination(50) === [0, 0, 0, 2] from the task description is not currently asserted in src/getCoinCombination.test.js, even though the behavior is already handled by your algorithm. This is a minor coverage issue, not a blocker, but you should still add a test like:
expect(getCoinCombination(50)).toEqual([0, 0, 0, 2]);in your quarters test group so that all described examples are verified. As an optional enhancement, you might also add a small test that asserts the result is always an array of length 4 with non-negative integers, to guard against future regressions. Overall, solid work on both the implementation and tests—just a small coverage tweak will make the suite fully aligned with the specification.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| test('should return correct amount of quarters (25 cents)', () => { | ||
| expect(getCoinCombination(25)).toEqual([0, 0, 0, 1]); | ||
| expect(getCoinCombination(75)).toEqual([0, 0, 0, 3]); | ||
| }); |
There was a problem hiding this comment.
The task description includes the example getCoinCombination(50) === [0, 0, 0, 2] but the quarters tests only assert 25 and 75. Add an explicit test for 50 cents, e.g. expect(getCoinCombination(50)).toEqual([0, 0, 0, 2]), so the suite fully covers the described examples .
No description provided.