|
int calculate_max_repetition(string dnaSequence) { |
|
int currentCount = 1; |
|
int maxCount = 1; |
|
for(int i=1; i<dnaSequence.length(); i++) { |
|
if (dnaSequence[i]==dnaSequence[i-1]) { |
|
currentCount++; |
|
} else { |
|
maxCount = max(currentCount, maxCount); |
|
currentCount = 1; |
|
} |
|
} |
|
return max(maxCount, currentCount); |
|
} |
In the calculate_max_repetition function, update the variable names from camelCase to snake_case to follow C++ naming conventions. Here are the current variable names to be updated:
Changes in the variable name:
dnaSequence → dna_sequence
currentCount → current_count
maxCount → max_count
Ensure the function compiles and works correctly after the renaming.
This change will improve readability and align with common C++ coding standards.
2025-01-CP/test-06-20001.cpp
Lines 20 to 32 in 6103ef2
In the
calculate_max_repetitionfunction, update the variable names from camelCase to snake_case to follow C++ naming conventions. Here are the current variable names to be updated:Changes in the variable name:
dnaSequence→dna_sequencecurrentCount→current_countmaxCount→max_countEnsure the function compiles and works correctly after the renaming.
This change will improve readability and align with common C++ coding standards.