@@ -0,0 +1,1434 @@
+package algorithms.warmup;%0D%0A%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/*%0D%0A * Problem Statement: %0D%0A * You are given time in AM/PM format. Convert this into a 24 hour format.%0D%0A * %0D%0A * Note Midnight is 12:00:00AM or 00:00:00 and 12 Noon is 12:00:00PM.%0D%0A * %0D%0A * Input Format: %0D%0A * Input consists of time in the AM/PM format i.e. hh:mm:ssAM or hh:mm:ssPM%0D%0A * where%0D%0A * 01 %3C= hh %3C= 12%0D%0A * 00 %3C= mm %3C= 59%0D%0A * 00 %3C= ss %3C= 59%0D%0A * %0D%0A * Output Format: %0D%0A * You need to print the time in 24 hour format i.e. hh:mm:ss%0D%0A * where%0D%0A * 00 %3C= hh %3C= 23%0D%0A * 00 %3C= mm %3C= 59%0D%0A * 00 %3C= ss %3C= 59%0D%0A * %0D%0A * Sample Input: %0D%0A * 07:05:45PM%0D%0A * %0D%0A * Sample Output: %0D%0A * 19:05:45%0D%0A */%0D%0Apublic class TimeConversion %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09Scanner sc = new Scanner(System.in);%0D%0A%09%09%0D%0A%09%09String timeString = sc.next();%0D%0A%09%09sc.close();%0D%0A%09%09%0D%0A%09%09String%5B%5D array = timeString.split(%22:%22);%0D%0A%0D%0A%09%09int hours = Integer.parseInt(array%5B0%5D);%0D%0A%09%09%0D%0A%09%09String amPM = array%5B2%5D.substring(2);%0D%0A%09%09%0D%0A%09%09String strHours;%0D%0A%09%09String outputTime;%0D%0A%09%09%0D%0A%09%09if (amPM.equals(%22PM%22)) %7B%0D%0A%09%09%09if (hours %3C 12) %7B%0D%0A%09%09%09%09hours += 12;%0D%0A%09%09%09%7D%0D%0A%09%09%09%0D%0A%09%09%09outputTime = hours + %22:%22 + array%5B1%5D + %22:%22 + array%5B2%5D.substring(0, 2);%0D%0A%09%09%7D else %7B%0D%0A%09%09%09if (hours == 12) %7B%0D%0A%09%09%09%09strHours = %2200%22;%0D%0A%09%09%09%09outputTime = strHours + %22:%22 + array%5B1%5D + %22:%22 + array%5B2%5D.substring(0, 2);%0D%0A%09%09%09%7D else %7B%0D%0A%09%09%09%09outputTime = array%5B0%5D + %22:%22 + array%5B1%5D + %22:%22 + array%5B2%5D.substring(0, 2); %0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%09System.out.println(outputTime);%0D%0A%09%7D%0D%0A%7D

Add TimeConversion