-
Notifications
You must be signed in to change notification settings - Fork 89
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
Added tasks 1331, 1332, 1333, 1334, 1335 #568
Conversation
for (Integer x : tmp) { | ||
if (!mp.containsKey(x)) mp.put(x, i++); | ||
mp.computeIfAbsent(x, k -> mp.put(k, i[0]++)); |
There was a problem hiding this comment.
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.
HashMap<Integer, Integer> mp = new HashMap<Integer, Integer>(); | ||
int i = 1; | ||
HashMap<Integer, Integer> mp = new HashMap<>(); | ||
final int[] i = {1}; | ||
for (Integer x : tmp) { |
There was a problem hiding this comment.
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.
SolutionTest > arrayRankTransform3() FAILED |
It fail with |
|
Ok, let's revert changes and add suppresswarning. |
➕ |
Kudos, SonarCloud Quality Gate passed! |
No description provided.