/* package codechef; // don’t place package namimport java.util.;
/* Name of the class has to be “Main” only if the class is public. */
public static void main(String args) throws java.lang.Exception
Scanner sc = new Scanner(System.in);
String output = “”;
testcase = Integer.parseInt(sc.next());
String str = "";
str = sc.next();
String arr = output.split(" ");
for(String a: arr)
Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile!
Also - what Problem are you trying to solve?
I’m trying to solve lapindrome problem, divide the string in two equal parts,if string length is odd ignore middle character and Check frequency of both the parts of it if frequency is equal print “YES” if not equal print “NO”
And it works on custom test cases but giving wrong answer.
And aslo after running it throwing runtime error but works on offline ide
although I am not much knowledgeable with java, and believing that string.charAt(x) will give you character at x index of the string.
Consider the case: abba
this isn’t a lapindrome but when you will find first and second with your logic. I will result in same value.
(ps: try making first and second strings)
Thank you for your kind reply
But “abba” is a lapindrome
What my will do is it will take int values of ‘a’ and ‘b’ and add them and store it in first
And for remaining half string store addition of int values of ‘b’ and ‘a’ and store it in second
And it will compare first and second if they are equal it will print yes and if not equal print no.