Skip to content

Change variable names from camelCase to snake_case for consistency with C++ naming conventions #19

@Ayushman-Saha

Description

@Ayushman-Saha

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:

  • dnaSequencedna_sequence
  • currentCount current_count
  • maxCountmax_count

Ensure the function compiles and works correctly after the renaming.
This change will improve readability and align with common C++ coding standards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions