You can generate a boilerplate code that saves your time while setting up a coding question. This boilerplate code or code stub handles the inputs and outputs in the code.
Adding code stubs is strongly recommended to save candidates time to avoid minor errors pertaining to the input and output format. The pre-generated code stub allows them to focus on the algorithm required to solve the problem instead of the input and output syntax.
The code stub can be automatically generated for most the languages by specifying the following:
|
Problem Description Write a program that reads a string and finds the first non-repeated character in that string. Treat the characters as case-sensitive. Therefore, "a" and "A" are different. You will be required to complete a given function nonRepeated. Input Format There is one sentence in the input that contains String Str. Constraints
Sample Test Case with Explanation Sample Input: balloonbA
Sample Output: a
Explanation "a" is the first character that is not repeated in the given string. Output Format A single character that represents the first character in Str that is not repeated. Code Stub
|
However, if you expect candidates to be familiar with the handling of input and output, you might choose not to generate any code stubs. Candidates have to write the complete code from scratch in this case.
Currently, you cannot generate code stubs automatically for the following languages:
For these languages, you can type the code stub manually in the editor.
To learn more about the input format for test cases, check out the Test Case Input Format article.