My issue
Why do we need to find the K if all the characters are same in the string. if s=“111” then why should we print k=2. Can anybody answer ?
My code
/*
* author : Vinaymiles
* created: 10/09/2024
*/
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//-------------------------------------------------------------------
#include <bits/stdc++.h>
//#include "algo/debug.h"
#define vi vector<long long int>
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define ll long long
#define ff first
#define ss second
#define yes cout<<"YES"<<endl;
#define no cout<<"NO"<<endl;
using namespace std;
#define JAYSHRIRAM ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
int main(int argc, char* argv[]) {
JAYSHRIRAM
int t;
for(cin>>t; t ; t--)
{
int n; cin>>n;
string s;
cin>>s;
// I am still confuse with the problem.
}
return 0;
}
//cout<<numeric_limits<double>::max()<<endl;
Problem Link: Convert string Practice Coding Problem