GUVI
Back

Input and output is the same for all cases, but still shows failed for Javascript

Created 3 years ago
2144 Views
1 Comments
MahithMadwesh
@MahithMadwesh
MahithMadwesh
@MahithMadweshProfile is locked. Login

Write a code to get the input in the given format and print the output in the given format

Input Description:
First-line indicates two integers separated by space. Second-line indicates two integers separated by space. Third-line indicates two integers separated by space.

Output Description:
Print the input in the same format.

Sample Input :
2 4
2 4
2 4
Sample Output :
2 4
2 4
2 4

and following is the code:

and output is exact:

Not getting why its showing error

Edit:
This was solved because the first array element is getting a space before. Fixed by putting a condition

if(j==0){

outString = outString + finalArray[i][j];

}else{

outString = outString+ ' ' + finalArray[i][j];

}

This solved my issue

Comments
Please login to comment.
 
Powered by habitate.io Habitate