Skip to content

Commit b9802ee

Browse files
authored
Merge pull request #783 from sir-gon/develop
[BUGFIX] SonarQube: Prefer class field declaration over `this` assign…
2 parents 09dacd8 + 90894c3 commit b9802ee

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/hackerrank/implementation/countApplesAndOranges.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ function countApplesAndOranges(s, t, a, b, apples, oranges) {
1818
}
1919
}
2020

21-
const result = [];
22-
result.push(cApples);
23-
result.push(cOranges);
21+
const result = [cApples, cOranges];
2422

2523
return result.join('\n');
2624
}

src/hackerrank/interview_preparation_kit/dynamic_programming/max_array_sum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const bigIntMax = (...args) =>
77
args.reduce((m, e) => (e > m ? e : m), BigInt(0));
88

99
function maxSubsetSum(arr) {
10-
const arrCopy = arr.map((x) => BigInt(x));
10+
const arrCopy = arr.map(BigInt);
1111

1212
if (arrCopy.length === 0) {
1313
return 0;

src/hackerrank/interview_preparation_kit/sort/ctci_bubble_sort.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
const SEPARATOR = '\n';
66

77
class SortableGroup {
8-
group;
8+
count = 0;
99

10-
count;
10+
group;
1111

1212
constructor(group) {
13-
this.count = 0;
1413
this.group = group;
1514
}
1615

0 commit comments

Comments
 (0)