Problems | Create a problem.
/problems
Request Body
| Field | Type | Description |
|---|---|---|
| title | String |
Problem title. |
| statement | String |
Problem statement. |
| input | String |
Input taking instructions for the problem. |
| output | String |
Output printing instructions for the problem. |
| sampleTestCases | Object |
Sample Testcases for the problem. |
| sampleTestCases.count | Number |
Sample Testcase count. |
| sampleTestCases.input | String |
Sample Testcase input. |
| sampleTestCases.output | String |
Sample Testcase output. |
| testCases | Object |
Main Testcases for the problem. |
| testCases.count | Number |
Main Testcase count. |
| testCases.input | String |
Main Testcase input. |
| testCases.output | String |
Main Testcase output. |
Success 200
| Field | Type | Description |
|---|---|---|
| problem | Object |
Newly created problem. |
| _id | String |
Problem id. |
| title | String |
Problem title. |
| statement | String |
Problem statement. |
| input | String |
Input taking instructions for the problem. |
| output | String |
Output printing instructions for the problem. |
| sampleTestCases | Object |
Sample Testcases for the problem. |
| count | Number |
Sample Testcase count. |
| input | String |
Sample Testcase input. |
| output | String |
Sample Testcase output. |
| testCases | Object |
Main Testcases for the problem. |
| count | Number |
Main Testcase count. |
| input | String |
Main Testcase input. |
| output | String |
Main Testcase output. |
HTTP/1.1 200 OK
{
"_id": "example_id- 343adresraedfe4re",
"title": "Problem title",
"statement": "Problem statement",
"input": "Input instructions",
"output": "Output instructions",
"sampleTestCases": {
"count": 2,
"input": "example input",
"output" : "example output"
},
"testCases": {
"count": 2,
"input": "example input",
"output" : "example output"
}
}
Error 4xx
| Name | Description |
|---|---|
| CreateProblemError |
Fields are missing or Invalid test case format or Internal Server Error. |