When one of the inputs is an array such as int[] (vector
in C++), the test case dialog will present you with a button to create
the array. Clicking this will bring up a new dialog box where you can
enter the data elements. There are a couple of ways to enter data here.
The most obvious is to enter the elements of the array one at a time
and click the '+' button (or press enter) after each one. You can move
the elements up or down using the '^' and 'v' buttons, respectively.
You can also remove items either one at a time, with the '-' button, or
all at once with the 'C' button. If you want to modify an element that
is already entered, you can double click on the element in the panel
above the entry field and modify it.
Adding elements one at a time can be slow, so there
are also two buttons that allow batch adding of elements. The simpler
of the two is the "++" button. To use this button, you should enter all
of the data elements as a comma delimited list, and then press the "++"
button. For example, typing 1,3,6,4 and pressing "++" will create the
array {1,3,6,4}. This button works exactly the same with all types of
arrays. The other batch add button is the "{}" button. To use this, you
should enter the data exactly as you would in your source code. So, to
input {1,3,6,4} you would enter {1,3,6,4} and click "{}". While this
may seem extraneous, given the "++" button, it has the advantage that
it will parse String arrays that use double quotes, so that you can
copy and paste the example test cases directly from the problem
statement. For example, to enter the String[], {"a","b","c"}, you would
simply have to enter {"a","b","c"} and press "{}". If you want to use
the characters " or \ in a String[], you have to escape them with a \.
Thus, \" represents a double quote, and \\ represents a single
backslash. For example {"\"\\\""} represents a String[] with the single
element: "\". The advantage to the "{}" button is that any array sample
input can be copied directly from the problem statement, and created by
pasting and clicking "{}". A couple of notes about the "{}" button are
that the curly brackets at the front and end are optional, and the
button will work without them. Also, whitespace that is not enclosed by
double quotes is ignored. Furthermore, the dialog works exactly the
same with all types of arrays. Thus, with the "{}" button {1,2,3} will
create an int[],{1,2,3}, if the data type is an int[], and will create
a String[], {"1","2","3"}, if the data type is a String[].