Skip to content

Commit 90f7668

Browse files
committed
fix: minor format
1 parent 50a39f9 commit 90f7668

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

java/Sliding Windows/SubstringAnagrams.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ public int substringAnagrams(String s, String t) {
88
int[] windowFreqs = new int[26];
99
// Populate 'expected_freqs' with the characters in string 't'.
1010
for (char c : t.toCharArray()) {
11-
expectedFreqs[c - 'a'] += 1;
11+
expectedFreqs[c - 'a']++;
1212
}
1313
int left, right;
1414
left = right = 0;
1515
while (right < lenS) {
1616
// Add the character at the right pointer to 'window_freqs'
1717
// before sliding the window.
18-
windowFreqs[s.charAt(right) - 'a'] += 1;
18+
windowFreqs[s.charAt(right) - 'a']++;
1919
// If the window has reached the expected fixed length, we
2020
// advance the left pointer as well as the right pointer to
2121
// slide the window.
@@ -25,7 +25,7 @@ public int substringAnagrams(String s, String t) {
2525
}
2626
// Remove the character at the left pointer from
2727
// 'window_freqs' before advancing the left pointer.
28-
windowFreqs[s.charAt(left) - 'a'] -= 1;
28+
windowFreqs[s.charAt(left) - 'a']--;
2929
left += 1;
3030
}
3131
right += 1;

0 commit comments

Comments
 (0)