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

Commit 897885b

Browse files
authored
Fixed sonar warning.
1 parent 6dd3ade commit 897885b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

‎src/main/java/g0301_0400/s0367_valid_perfect_square/Solution.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public boolean isPerfectSquare(int num) {
1313
long end = num;
1414
long mid = 0;
1515
while (start <= end) {
16-
// untill start is lesser or equal to end do this
16+
// until start is lesser or equal to end do this
1717
// Finding middle value
1818
mid = start + (end - start) / 2;
1919
if (mid * mid == num) {

‎src/main/java/g0301_0400/s0368_largest_divisible_subset/Solution.java‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
public class Solution {
1010
// Helper class containing value and an arraylist
11-
public class Helper {
11+
private class Helper {
1212
int val;
1313
List<Integer> al;
1414

@@ -34,11 +34,9 @@ public List<Integer> largestDivisibleSubset(int[] nums) {
3434
int max2 = 0;
3535
int pos = i;
3636
for (int j = 0; j < i; j++) {
37-
if (nums[i] % nums[j] == 0) {
38-
if (max2 < dp[j].val) {
39-
max2 = dp[j].val;
40-
pos = j;
41-
}
37+
if (nums[i] % nums[j] == 0 && max2 < dp[j].val) {
38+
max2 = dp[j].val;
39+
pos = j;
4240
}
4341
}
4442
// max2 = 0, means no element exists which can divide the present element

0 commit comments

Comments
(0)

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