We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- All Contests
- HourRank 7
- Paint The Tiles
- Discussions
Paint The Tiles
Paint The Tiles
Sort by
recency
|
11 Discussions
|
Please Login in order to post a comment
Hey here is my code in python 3!! All test cases passes with just tiny code below:
import sys N = int(input().strip()) C = input().strip() count=1 for i in range(len(C)-1):
if len(set(C))==1: break else: if C[i]!=C[i+1]: count+=1 print(count)
using System.CodeDom.Compiler; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.Serialization; using System.Text.RegularExpressions; using System.Text; using System;
class Solution {
}
int main(){ int N; scanf("%d",&N); char a[N]; int count=0; scanf("%s",a);
}