(This question is a variation of the LeetCode question 424. Longest Repeating Character Replacement . If you haven't completed that question yet, it is recommended to solve it first.)
A game renders shaders using two GPUs: GPU a and GPU b.
You are given a string s where:
s[i] = 'a'→ theshader uses GPUas[i] = 'b'→ theshader uses GPUb
The idleness of the system is defined as the maximum number of consecutive shaders that use the same GPU.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected