From 71b6192762695b72c364e53b455abae5ac9cfbc4 Mon Sep 17 00:00:00 2001 From: tavisca-ragupta Date: Wed, 26 Jun 2019 17:04:39 +0530 Subject: [PATCH] Second Problem Solution --- TimeProblem.cs | 168 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 TimeProblem.cs diff --git a/TimeProblem.cs b/TimeProblem.cs new file mode 100644 index 0000000..6a4794b --- /dev/null +++ b/TimeProblem.cs @@ -0,0 +1,168 @@ +using System; +public class ForumPostEasy +{ + static ForumPostEasy obj ; + public static bool IsValidInput(int[,] times,string[][] postTime) + { + try{ + string compare_string = null; + string isEmp = null; + string[] hashTable = new string[29]; + int hash_value = 0,hash_var=6; + for(int i=0;itimes[max,j]) + { + max = i; + break; + } + if(times[i,j]occured_time) + { + f = t + occured_time; + times[i,lower_index] = f/10; + times[i,upper_index] = f%10; + } + else + { + f = occured_time - remaining; + times[i,lower_index] = f/10; + times[i,upper_index] = f%10; + if(type=="Seconds") + obj.MakeChanges(i,lower_index-2,upper_index-2,times,1,60,"Minutes"); + if(type=="Minutes") + obj.MakeChanges(i,lower_index-2,upper_index-2,times,1,24,"Hours"); + } + } + public static int GetTime(int[,] times,string[][] b) + { + for(int i=0;i