Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #390

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

update #390

wants to merge 1 commit into from

Conversation

Kronnes15
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on the test cases! They are well-structured and comprehensive. Just a small note: consider translating comments to English for broader accessibility. Keep up the great work! 🌟

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

@@ -7,15 +7,15 @@
*/
function getCoinCombination(cents) {
let currentAmount = cents;
const values = [1, 5, 10, 25];
const values = [25, 10, 5, 1]; // Починаємо з кварталів

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is in Ukrainian. Consider translating it to English for consistency and better understanding by a wider audience.

coins[i] = Math.floor(currentAmount / values[i]);
currentAmount -= coins[i] * values[i];
}

return coins;
return [coins[3], coins[2], coins[1], coins[0]];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return statement reverses the order of the coins array. This means the function will return the number of pennies, nickels, dimes, and quarters, instead of quarters, dimes, nickels, and pennies. If the task requires returning the coins in the order of quarters, dimes, nickels, and pennies, you should return the 'coins' array as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants