CDVNT01B - Editorial

PROBLEM LINK:

Practice

Contest: CodeVenture 1.0

Setter: Nisarg Thakkar

Tester: Krunal Mathukiya

Editorialist: Malhar Patel

DIFFICULTY:

Easy-medium

PREREQUISITES:

Nothing

PROBLEM:

The idea behind the problem boils down to following : You are given a string and you have to find the minimum distance which you can travel by using the maximum number of a single character.

EXPLANATION

Let’s say we have a string baaabb, then we can go from 1 to 6 by using three b's or from 2 to 4 by using three a's. And according to the Question, we can say that the latter is the choice we want and so we have explained the logic.

SOLUTIONS:

CPP Solution

Code

Feel free to Share your approach, if you want to. (even if it’s the same :stuck_out_tongue: ) . Suggestions are welcomed as always had been. :slight_smile:

When was this contest and was this a private contest?

It was a private contest we hosted for our college and it is good enough for beginners to practice and it can also prove enjoying for experts too. You can give it a try…