30 days notice period. Strong in Data Structures and Algorithms with intuitive problem-solving skills. Proficient in Python, C/C++, SQL, Selenium, Test Case, Automation Testing, Manual Testing, Softw...
McAfee - SDET Engineer
Jaypee Institute of Information Technology, Noida 2022
My Stats
EXP gained
2369
Level
5 (Champion)
Community stats
Discussions
2
0
Know more
37
Total problems solved
21
Easy
14
Moderate
2
Hard
0
Ninja

Current streak:

0 days

Longest streak:

10 days

Less

More

Discussions
Interview problems

//There are only two possibilities either string will start with 0 or 1;

int makeBeautiful(string str) { // Write your code here    int n=str.length();    int res1=0,res2=0;

// Loop to count no. of flip required to make string beautiful when start with 0;    for(int i=0; i<n; i++)    {        if(i%2==0)        {            if(str[i]!='0')                res1++;                    }                if(i%2!=0)        {            if(str[i]!='1')                res1++;                    }              }

// Loop to count no. of flip required to make string beautiful when start with 1;    for(int i=0; i<n; i++)    {        if(i%2==0)        {            if(str[i]!='1')                res2++;                    }                if(i%2!=0)        {            if(str[i]!='0')                res2++;                    }              }        return min(res1,res2);         }