Hey,
I got every testcases correct, but one validator failed (Test full alphabet in CAPS WMADXESFGIJVTHKNOBPLYQRUZC) and I have no idea why
When I played custom testcase and put these letters in, the result looked fine.
Anyone had this problem too?
Is there a way to see how my program goes through this validator (other then custom test case, since I cannot know everything, like values for l, h)?
I need help to split a string by nth position. I would like to split every 4th character in the ASCII string. Thanks for the help.
class Solution {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int L = in.nextInt();
int H = in.nextInt();
if (in.hasNextLine()) {
in.nextLine();
}
String T = in.nextLine();
int length=T.length(); //Getting length of given string
char [] allChar= new char [length];
for(int i=0; i<length;i++){ //Fitting Given String into Char to get ASCII code
allChar[i]=T.charAt(i);
}
for (int i = 0; i < H; i++) {
String ROW = in.nextLine();
String [] charactersf=ROW.split(".{1,3}"); //I need help to convert the first line of the ASCII letters to an array of 4 characters each
for(int z=0; z<length;z++){
int x=0;
x=((int) allChar[z])-65;
System.out.print(charactersf[x]);
}
System.out.println();
}
// Write an action using System.out.println()
// To debug: System.err.println("Debug messages...");
}
The puzzle said, âThe characters a to z are shown in ASCII art by their equivalent in upper case.â
Change lower cases in inputs to upper cases in output.
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int L = in.nextInt();
int H = in.nextInt();
if (in.hasNextLine()) {
in.nextLine();
}
String T = in.nextLine();
int uz=T.length();
char dizge[]=new char[T.length()];
dizge=T.toCharArray();
String f[];
for (int i = 0; i < H; i++) {
String ROW = in.nextLine();
f=ROW.split(" ");
String dizi[][]=new String[H][f.length];
for(int x=0;x<f.length;x++)
{ dizi[i][x]=f[x]+" ";
System.out.print(dizi[i][x]);
}
System.out.println();
}
System.out.println(dizi[0][1]);
int de;
for(int a=0;a<uz;a++){
de= (int) dizge[a];
de -=64;System.out.println(de);
}
for(int a=0;a<3;a++){