My testcases are showing error

you have to take the the no. of testcases as an input…use stringbuilder instead of string to increase performance