what are test cases in this problem(as I am new to coding)

Ada has an array of N crayons, some crayons are pointing upwards and some downwards. Ada thinks that an array of crayons is beautiful if all the crayons are pointing in the same direction.

In one step you can flip any segment of consecutive crayons. After flipping a segment, all crayons pointing downwards will point upwards and visceversa

What is the minimum number of steps to make the array of crayons beautiful?

Input
The first line of the input contains T the number of test cases. Each test case is described in one line containing a string S of N characters, the i-th character is ā€˜Uā€™ if the i-th crayon is pointing upwards and ā€˜Dā€™ if it is pointing downwards.

Output
For each test case, output a single line containing the minimum number of flips needed to make all crayons point to the same direction.

I think you wanna know what is the meaning of the word test cases.

DEFINITION
A test case is a set of conditions or variables under which a tester will determine whether a system under test satisfies requirements or works correctly.

The process of developing test cases can also help find problems in the requirements or design of an application.
Read more about it here

for ex:
In this question Ada and Crayons, test case are:

1   
UUDDUU

or

 4  
 UUDD
 UD
 DDDUU
 DU

here 1 and 4 are number of test cases.

a good answer by @ayushagg31 but in simple language test cases are different instances of input parameters against which online judge tests your program and checks whether it is producing correct output or not. In the mentioned questions input parameter is the string representing alignment of crayons and inputs like UUD,DUUD etc are the test cases. At codechef you can not see the test cases for any problem so if your program is giving a WA(Wrong Answer) verdict you have to find error in your program on your own by testing it against different test cases written by yourself.

1 Like