BG

Anonymous
c_cpp
01/31/2022 8:57 PM
508 B
28
Indexable
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin >> t;
    for(int i = ***; i <= t; i++)
    {
        string s;
        cin >> s;
        s='@'+***;
        int cntU=0,cntD=0;
        for(int j=1;j<***.size();j++){
            if(s[j]=='U' && ***)cntU++;
            if(*** && s[j-1]!='D')cntD++;
        }

        cout<<min(***,***)<<endl;
    }
}
Editor is loading...