Hello @kaushik_iska and @anton_lunyov. The testcases which checks the code of the user for the problem have wrong format. When you write the code in c# with the same logic as that of when you write it in c++ (CodeChef: Practical coding for everyone), you get the wrong answer. Its because of the format of the data which tests the code. Please check my submission here in c# (CodeChef: Practical coding for everyone) , which tries to convert the input in lower cases throws runtime error, while this submission which doesn;t (CodeChef: Practical coding for everyone) gives the wrong answer (wrong answer is fine as logic is not correct). But as the format of data is wrong , I have wasted lot of time on it. Please check the format of the data before putting any problem here. Thanks.