Created
July 17, 2016 13:44
-
-
Save Jack-Saleem/3e08bc1166be372caae02bd20d7d1e8e to your computer and use it in GitHub Desktop.
codeforces 266B QueueattheSchool program in java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class QueueattheSchool | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
int n=z.nextInt(); | |
int t=z.nextInt(); | |
String s=z.next(); | |
for(int i=1;i<=t;i++) | |
{ | |
if(s.contains("BG")) | |
s=s.replaceAll("BG", "GB"); | |
} | |
System.out.println(s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment