Replace the Substring for Balanced String
You are given a string containing only 4 types of characters: 'Q', 'W', 'E', and 'R'. A string is said to be balanced if each of its characters appears n/4 times where n is the length of the string. Return the minimum length of a contiguous substring in the given string that needs to be replaced to make the string balanced.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)