Task Description: Find Minimum Replacement Length in DNA Sequence
Functionality
Implement a function that determines the minimum length of a contiguous substring in a given DNA sequence (gene) that must be replaced to make the gene "steady." A steady gene is defined as one where each of the four nucleotides ('A', 'C', 'G', 'T') occurs an equal number of times.
Input/Output Requirements
Input:
A string gene representing the DNA sequence, consisting solely of the characters 'A', 'C', 'G', and 'T'.
An optional parameter n which, if not provided, will automatically be set to the length of gene.
Output:
An integer representing the minimum length of the substring that needs to be replaced in order to make the gene steady.
The function should raise a ValueError if the length of the gene n is not divisible by 4.
Implementation Details
The solution should make use of a sliding window approach to efficiently determine the minimal substring length that can be replaced.
Ensure that the function handles cases where the gene is already steady by returning 0.
File Structure
Write the implementation in a file called /app/solution.py. The file should contain the find_min_replacement_length function with the specified signature and implementation.