You are viewing a single comment's thread. Return to all comments →
I didn't pass #1,3,4,8 test cases. Could anyone tell me why?
import java.io.; import java.util.;
public class Solution {
public static void main(String[] args) { Scanner sc = new Scanner(System.in); String in = sc.next(); char[] inChar = in.toCharArray(); char[] out = Arrays.copyOfRange(inChar, 0, 8); if(inChar[8] == 'A' && in.substring(0,2) == "12") { out[0] = 0; out[1] = 0; } else if(inChar[8] =='P' && in.substring(0,2) != "12") { String s = "" + (Integer.parseInt(in.substring(0,2)) + 12); char[] f = s.toCharArray(); out[0] = f[0]; out[1] = f[1]; } System.out.println(out); }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Time Conversion
You are viewing a single comment's thread. Return to all comments →
I didn't pass #1,3,4,8 test cases. Could anyone tell me why?
import java.io.; import java.util.;
public class Solution {
}