run time error 
Разница между en2 и en3, 3 символ(ов) изменены
my code works on my ide but gives run time error on submission on codeforces.I can't understand why is this happening.↵
Any help is appreciated.↵


here is my code:-↵

import java.util.*;↵
public class leftHand_RightHand {↵

public static void main(String[] args) {↵
Scanner scn = new Scanner(System.in);↵

scn.nextLine();↵
String str=scn.nextLine();↵
// System.out.println(str+" "+str.length());↵

for(int i=0,j=(str.length()/2);i<(str.length()/2) && j<str.length();i++,j++) {↵
if((str.charAt(i)=='L' && str.charAt(j)=='L') || ( str.charAt(i)=='R' &&  str.charAt(j)=='R'))↵
System.out.println((i+1)+" "+(j+1));↵

else if( str.charAt(i)=='L'&&  str.charAt(j)=='R')  ↵
System.out.println((i+1)+" "+(j+1));↵

else if( str.charAt(i)=='R'&& str.charAt(j)=='L') ↵
System.out.println((j+1)+" "+(i+1));↵
}↵

}

}

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский kirtidabas 2019-06-12 14:12:23 3 Tiny change: 'n }\n \n }' -> 'n }\n \n }\n}'
en2 Английский kirtidabas 2019-06-12 14:10:35 2 Tiny change: 'lp is appriciated.\n\' -> 'lp is appreciated.\n\'
en1 Английский kirtidabas 2019-06-12 14:09:25 857 Initial revision (published)