Skip to content

Commit 4c6a515

Browse files
authored
Fixed Formatting 1647-minimum-deletions-to-make-character-frequencies-unique.js
1 parent 62ebeab commit 4c6a515

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

javascript/1647-minimum-deletions-to-make-character-frequencies-unique.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ var minDeletions = function(s) {
1010
// hash frequency
1111
let i = 0;
1212
const charHash = new Map();
13-
while(i < s.length) {
13+
while (i < s.length) {
1414
const frequency = charHash.get(s[i]) || 0;
15-
charHash.set(s[i], frequency+1);
15+
charHash.set(s[i], frequency + 1);
1616
i++;
1717
}
1818
const frequencyHash = new Map();
19-
for(const [key, val] of charHash) {
19+
for (const [key, val] of charHash) {
2020
const frequency = frequencyHash.get(val) || 0;
21-
frequencyHash.set(val, frequency+1);
21+
frequencyHash.set(val, frequency + 1);
2222
}
2323

2424
let min = 0;
25-
for(const [key, val] of frequencyHash) {
25+
for (const [key, val] of frequencyHash) {
2626
let frequency = key;
2727
let frequencyOfFrequency = val;
2828
while(frequencyOfFrequency > 1) {
2929
while(frequencyHash.has(frequency)) {
3030
frequency -= 1;
3131
min += 1;
3232
}
33-
if(frequency > 0) frequencyHash.set(frequency, 1);
33+
if (frequency > 0) frequencyHash.set(frequency, 1);
3434
frequency = key;
3535
frequencyOfFrequency -= 1;
3636
}

0 commit comments

Comments
 (0)