Algorithm · Squarepoint · Hard
(This problem is a variation of the LeetCode question 424. Longest Repeating Character Replacement. If you haven't solved that one yet, it's a good idea to tackle it first.) A game distributes shader rendering across two GPUs, labeled a and b. You are given a string s where: s[i] = 'a' means the $$i^{th}$$ shader is assigned to GPU a s[i] = 'b' means the $$i^{th}$$ shader is assigned to GPU b The idleness of the system is the maximum length of a contiguous block of shaders…
Checking your access…