Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added tasks 1331, 1332, 1333, 1334, 1335 #568

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

Merged
javadev merged 6 commits into javadev:main from ThanhNIT:tasks-1331-1332-1333-1334-1335
Mar 19, 2022

Conversation

@ThanhNIT
Copy link
Contributor

@ThanhNIT ThanhNIT commented Mar 19, 2022

No description provided.

finalint[] i = {1};
for (Integer x : tmp) {
if (!mp.containsKey(x)) mp.put(x, i++);
mp.computeIfAbsent(x, k -> mp.put(k, i[0]++));
Copy link
Owner

Choose a reason for hiding this comment

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

It may be putIfAbsent method.

ThanhNIT reacted with thumbs up emoji
int i = 1;
HashMap<Integer, Integer> mp = new HashMap<>();
finalint[] i = {1};
for (Integer x : tmp) {
Copy link
Owner

Choose a reason for hiding this comment

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

It may be just variable i and putIfAbsent method.

Copy link
Owner

javadev commented Mar 19, 2022

SolutionTest > arrayRankTransform3() FAILED
java.lang.AssertionError at SolutionTest.java:25

Copy link
Contributor Author

SolutionTest > arrayRankTransform3() FAILED java.lang.AssertionError at SolutionTest.java:25

It fail with putIfAbsent

Copy link
Contributor Author

SolutionTest > arrayRankTransform3() FAILED java.lang.AssertionError at SolutionTest.java:25

It fail with putIfAbsent

Copy link
Owner

javadev commented Mar 19, 2022

SolutionTest > arrayRankTransform3() FAILED java.lang.AssertionError at SolutionTest.java:25

It fail with putIfAbsent

Ok, let's revert changes and add suppresswarning.

Copy link
Owner

javadev commented Mar 19, 2022

@javadev javadev merged commit d5ed891 into javadev:main Mar 19, 2022
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@javadev javadev javadev left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /