Skip to content

solution#967

Open
VSkits wants to merge 2 commits into
mate-academy:mainfrom
VSkits:develop
Open

solution#967
VSkits wants to merge 2 commits into
mate-academy:mainfrom
VSkits:develop

Conversation

@VSkits

@VSkits VSkits commented Jun 30, 2025

Copy link
Copy Markdown

No description provided.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Thank you for your work on the test file—it is well-structured and covers all the necessary scenarios! 😊 However, the implementation of the splitInteger function itself is missing from your pull request. This is a critical issue because the core requirement is to provide a working function, and without it, the tests cannot verify any functionality. Please add the implementation file for splitInteger so your solution can be considered complete. Once that's done, your submission should be ready for approval! Keep up the good work! 🚀


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Great job! 🎉 Your implementation meets all the core requirements of the task, including sorting the result as specified and ensuring the correct distribution of values. The previous suggestions to remove sorting and change test expectations were based on a misunderstanding of the requirements—your current approach is correct, as the task explicitly asks for a sorted result. All tests are present and valid, and your code is functional and well-structured. Keep up the good work!


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

Footnotes

  1. Rate AI review example

Comment thread src/splitInteger.js
}

return parts;
return parts.sort((a, b) => a - b);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Issue: Sorting the parts array before returning it changes the order of the parts, which is not required and will cause test failures if the tests expect the parts in the order they were generated. Please remove the .sort((a, b) => a - b) to return the parts in their original order.

Comment thread src/splitInteger.test.js

test('should sort parts ascending if they are not equal', () => {

expect(splitInteger(10, 3)).toEqual([3, 3, 4]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Issue: The test expects the result [3, 3, 4] (ascending order), but the function should return the parts in the order they are generated, which would be [4, 3, 3] for splitInteger(10, 3). Update the expected value to match the correct order.

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