Skip to content

try1 - #1479

Open
Dazai-osa wants to merge 16 commits into
mate-academy:masterfrom
Dazai-osa:feature/try1
Open

try1#1479
Dazai-osa wants to merge 16 commits into
mate-academy:masterfrom
Dazai-osa:feature/try1

Conversation

@Dazai-osa

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! There are several critical issues that need to be fixed before your solution can be accepted. The main problems are: the date range check is not inclusive, there is a typo and logic error in your variable assignment, the output format does not match the requirements (it should be built with StringBuilder, not by returning a Map), and the use of Map is not allowed for this task. Also, please remove any unnecessary imports. Please address these points and resubmit—you're on the right track, just a few important corrections to make! 🚀


✨ 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


import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The import of java.util.Date is unnecessary and not used in the code. According to the checklist, unused imports should be removed.

int fullSalary = 0;
LocalDate firstDate = LocalDate.parse(dateFrom, formatter);
LocalDate lustDate = LocalDate.parse(dateFrom, formatter);
for (String start : data) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is a typo: lustDate should be lastDate. Also, you are parsing dateFrom twice; the second one should be dateTo to represent the end of the date range. This is a logic error.

String[] parts = start.split(" ");
LocalDate date = LocalDate.parse(parts[0], formatter);
if (date.isAfter(firstDate) && date.isBefore(lustDate) && name.equals(parts[1])) {
int hours = Integer.parseInt(parts[2]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The date range check uses isAfter(firstDate) and isBefore(lustDate), which excludes the boundary dates. According to the checklist, the range should be inclusive, so you should use !date.isBefore(firstDate) && !date.isAfter(lastDate).

salaryMap.put(name, fullSalary);
}
return salaryMap.toString();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Returning salaryMap.toString() does not match the required output format. The checklist specifies that the output should be formatted as described in the task description, not as a map string.

@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 requirements and constraints, with clear logic, proper formatting, and no critical issues. Keep up the excellent work!


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

Footnotes

  1. Rate AI review example

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