Skip to content

Commit 9659470

Browse files
committed
Sync LeetCode submission Runtime - 4 ms (32.65%), Memory - 18 MB (6.36%)
1 parent 831b146 commit 9659470

File tree

1 file changed

+6
-4
lines changed
  • 3753-maximum-difference-between-even-and-odd-frequency-i

1 file changed

+6
-4
lines changed

3753-maximum-difference-between-even-and-odd-frequency-i/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
<p>You are given a string <code>s</code> consisting of lowercase English letters. Your task is to find the <strong>maximum</strong> difference between the frequency of <strong>two</strong> characters in the string such that:</p>
1+
<p>You are given a string <code>s</code> consisting of lowercase English letters.</p>
2+
3+
<p>Your task is to find the <strong>maximum</strong> difference <code>diff = freq(a<sub>1)</sub> - freq(a<sub>2</sub>)</code> between the frequency of characters <code>a<sub>1</sub></code> and <code>a<sub>2</sub></code> in the string such that:</p>
24

35
<ul>
4-
<li>One of the characters has an <strong>even frequency</strong> in the string.</li>
5-
<li>The other character has an <strong>odd frequency</strong> in the string.</li>
6+
<li><code>a<sub>1</sub></code> has an <strong>odd frequency</strong> in the string.</li>
7+
<li><code>a<sub>2</sub></code> has an <strong>even frequency</strong> in the string.</li>
68
</ul>
79

8-
<p>Return the <strong>maximum</strong> difference, calculated as the frequency of the character with an <b>odd</b> frequency <strong>minus</strong> the frequency of the character with an <b>even</b> frequency.</p>
10+
<p>Return this <strong>maximum</strong> difference.</p>
911

1012
<p>&nbsp;</p>
1113
<p><strong class="example">Example 1:</strong></p>

0 commit comments

Comments
 (0)