Skip to content

Commit 1063e32

Browse files
committed
fix: comment for consistent to java variable names
1 parent cdf8f8e commit 1063e32

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

java/Sliding Windows/LongestSubstringWithUniqueChars.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public int longestSubstringWithUniqueChars(String s) {
1515
left++;
1616
}
1717
// Once there are no more duplicates in the window, update
18-
// 'max_len' if the current window is larger.
18+
// 'maxLen' if the current window is larger.
1919
maxLen = Math.max(maxLen, right - left + 1);
2020
hashSet.add(s.charAt(right));
2121
// Expand the window.

java/Sliding Windows/SubstringAnagrams.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ public int substringAnagrams(String s, String t) {
66
int count = 0;
77
int[] expectedFreqs = new int[26];
88
int[] windowFreqs = new int[26];
9-
// Populate 'expected_freqs' with the characters in string 't'.
9+
// Populate 'expectedFreqs' with the characters in string 't'.
1010
for (char c : t.toCharArray()) {
1111
expectedFreqs[c - 'a']++;
1212
}
1313
int left, right;
1414
left = right = 0;
1515
while (right < lenS) {
16-
// Add the character at the right pointer to 'window_freqs'
16+
// Add the character at the right pointer to 'windowFreqs'
1717
// before sliding the window.
1818
windowFreqs[s.charAt(right) - 'a']++;
1919
// If the window has reached the expected fixed length, we
@@ -24,7 +24,7 @@ public int substringAnagrams(String s, String t) {
2424
count += 1;
2525
}
2626
// Remove the character at the left pointer from
27-
// 'window_freqs' before advancing the left pointer.
27+
// 'windowFreqs' before advancing the left pointer.
2828
windowFreqs[s.charAt(left) - 'a']--;
2929
left += 1;
3030
}

0 commit comments

Comments
 (0)