-
Notifications
You must be signed in to change notification settings - Fork 93
Added tasks 345, 349. #106
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
Conversation
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 class name without package.
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 a class name without package.
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.
src/main/java/g0301_0400/s0349_intersection_of_two_arrays/Solution.java:[20] (blocks) NeedBraces: 'for' construct must use '{}'s.
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.
Please move comment after package.
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.
Please use faster solution, this is too slow.
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.
You may use solution filter.
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.
Ok, I will update
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.
Please use this solution.
class Solution { private boolean isVowel(char c) { return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U'; } private StringBuilder swap(StringBuilder s, int l, int r) { char tmp = s.charAt(l); s.setCharAt(l, s.charAt(r)); s.setCharAt(r, tmp); return s; } public String reverseVowels(String s) { int l = 0; int r = s.length() - 1; StringBuilder res = new StringBuilder(s); while (l < r) { while (l < r && !isVowel(s.charAt(l))) { l++; } while (l < r && !isVowel(s.charAt(r))) { r--; } res = swap(res, l, r); l++; r--; } return res.toString(); } }
You may use other email for commits
Thanh829 <tristian.ma@watasolutions.com>
git config user.name "John Doe"
git config user.email johndoe@example.com
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.
Please add public.
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.
Please format source codes.
Theare are checkstyle warnings
Error: src/main/java/g0301_0400/s0349_intersection_of_two_arrays/Solution.java:[10,20] (misc) ArrayTypeStyle: Array brackets at illegal position.
Error: src/main/java/g0301_0400/s0349_intersection_of_two_arrays/Solution.java:[11] (blocks) NeedBraces: 'for' construct must use '{}'s.
Error: src/main/java/g0301_0400/s0349_intersection_of_two_arrays/Solution.java:[19,19] (misc) ArrayTypeStyle: Array brackets at illegal position.
Error: src/main/java/g0301_0400/s0349_intersection_of_two_arrays/Solution.java:[20] (blocks) NeedBraces: 'for' construct must use '{}'s.
There is sonar warning
Kudos, SonarCloud Quality Gate passed! Quality Gate passed
Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells
No description provided.