Class Solution
java.lang.Object
g0801_0900.s0830_positions_of_large_groups.Solution
830 - Positions of Large Groups.<p>Easy</p>
<p>In a string <code>s</code> of lowercase letters, these letters form consecutive groups of the same character.</p>
<p>For example, a string like <code>s = "abbxxxxzyy"</code> has the groups <code>"a"</code>, <code>"bb"</code>, <code>"xxxx"</code>, <code>"z"</code>, and <code>"yy"</code>.</p>
<p>A group is identified by an interval <code>[start, end]</code>, where <code>start</code> and <code>end</code> denote the start and end indices (inclusive) of the group. In the above example, <code>"xxxx"</code> has the interval <code>[3,6]</code>.</p>
<p>A group is considered <strong>large</strong> if it has 3 or more characters.</p>
<p>Return <em>the intervals of every <strong>large</strong> group sorted in <strong>increasing order by start index</strong></em>.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> s = “abbxxxxzzy”</p>
<p><strong>Output:</strong> <a href="3,6">3,6</a></p>
<p><strong>Explanation:</strong> <code>"xxxx" is the only</code> large group with start index 3 and end index 6.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> s = “abc”</p>
<p><strong>Output:</strong> []</p>
<p><strong>Explanation:</strong> We have groups “a”, “b”, and “c”, none of which are large groups.</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> s = “abcdddeeeeaabbbcd”</p>
<p><strong>Output:</strong> [[3,5],[6,9],[12,14]]</p>
<p><strong>Explanation:</strong> The large groups are “ddd”, “eeee”, and “bbb”.</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= s.length <= 1000</code></li>
<li><code>s</code> contains lowercase English letters only.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
largeGroupPositions
-