Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- void MaxSubsequence () {
- int size;
- cin>>size;
- string value;
- cin>>value;
- char temp;
- int counter = 0;
- for(int i=0;i<size;i++){
- if(i == 0){
- temp = value[i];
- counter++;
- } else {
- if(value[i] != temp){
- counter++;
- temp = value[i];
- }
- }
- }
- cout<<counter;
- }
- int main() {
- MaxSubsequence();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement