Repository navigation
Expand file tree
/
Copy pathpostman_leetcode_tests.json
More file actions
204 lines (204 loc) · 26.1 KB
/
Copy pathpostman_leetcode_tests.json
File metadata and controls
204 lines (204 loc) · 26.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
{
"info": {
"name": "CodeBox - LeetCode Style Tests",
"description": "Test code with multiple test cases like LeetCode",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"auth": {
"type": "apikey",
"apikey": [
{ "key": "key", "value": "X-Auth-Token", "type": "string" },
{ "key": "value", "value": "dev-token", "type": "string" },
{ "key": "in", "value": "header", "type": "string" }
]
},
"variable": [
{ "key": "baseUrl", "value": "http://localhost:3000" }
],
"item": [
{
"name": "Problem 1: Sum of Two Numbers",
"description": "Given two integers, return their sum.\n\nInput: Two integers on separate lines\nOutput: Sum of the two integers",
"item": [
{
"name": "Python - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"a = int(input())\\nb = int(input())\\nprint(a + b)\",\n \"language_id\": 71,\n \"stdin\": \"1\\n2\",\n \"expected_output\": \"3\"\n },\n {\n \"source_code\": \"a = int(input())\\nb = int(input())\\nprint(a + b)\",\n \"language_id\": 71,\n \"stdin\": \"0\\n0\",\n \"expected_output\": \"0\"\n },\n {\n \"source_code\": \"a = int(input())\\nb = int(input())\\nprint(a + b)\",\n \"language_id\": 71,\n \"stdin\": \"-5\\n5\",\n \"expected_output\": \"0\"\n },\n {\n \"source_code\": \"a = int(input())\\nb = int(input())\\nprint(a + b)\",\n \"language_id\": 71,\n \"stdin\": \"100\\n200\",\n \"expected_output\": \"300\"\n },\n {\n \"source_code\": \"a = int(input())\\nb = int(input())\\nprint(a + b)\",\n \"language_id\": 71,\n \"stdin\": \"-10\\n-20\",\n \"expected_output\": \"-30\"\n },\n {\n \"source_code\": \"a = int(input())\\nb = int(input())\\nprint(a + b)\",\n \"language_id\": 71,\n \"stdin\": \"999999\\n1\",\n \"expected_output\": \"1000000\"\n }\n ]\n}"
}
}
},
{
"name": "JavaScript - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"const fs = require('fs');\\nconst input = fs.readFileSync(0, 'utf8').trim().split('\\\\n');\\nconst a = parseInt(input[0]);\\nconst b = parseInt(input[1]);\\nconsole.log(a + b);\",\n \"language_id\": 63,\n \"stdin\": \"1\\n2\",\n \"expected_output\": \"3\"\n },\n {\n \"source_code\": \"const fs = require('fs');\\nconst input = fs.readFileSync(0, 'utf8').trim().split('\\\\n');\\nconst a = parseInt(input[0]);\\nconst b = parseInt(input[1]);\\nconsole.log(a + b);\",\n \"language_id\": 63,\n \"stdin\": \"0\\n0\",\n \"expected_output\": \"0\"\n },\n {\n \"source_code\": \"const fs = require('fs');\\nconst input = fs.readFileSync(0, 'utf8').trim().split('\\\\n');\\nconst a = parseInt(input[0]);\\nconst b = parseInt(input[1]);\\nconsole.log(a + b);\",\n \"language_id\": 63,\n \"stdin\": \"-5\\n5\",\n \"expected_output\": \"0\"\n },\n {\n \"source_code\": \"const fs = require('fs');\\nconst input = fs.readFileSync(0, 'utf8').trim().split('\\\\n');\\nconst a = parseInt(input[0]);\\nconst b = parseInt(input[1]);\\nconsole.log(a + b);\",\n \"language_id\": 63,\n \"stdin\": \"100\\n200\",\n \"expected_output\": \"300\"\n },\n {\n \"source_code\": \"const fs = require('fs');\\nconst input = fs.readFileSync(0, 'utf8').trim().split('\\\\n');\\nconst a = parseInt(input[0]);\\nconst b = parseInt(input[1]);\\nconsole.log(a + b);\",\n \"language_id\": 63,\n \"stdin\": \"-10\\n-20\",\n \"expected_output\": \"-30\"\n },\n {\n \"source_code\": \"const fs = require('fs');\\nconst input = fs.readFileSync(0, 'utf8').trim().split('\\\\n');\\nconst a = parseInt(input[0]);\\nconst b = parseInt(input[1]);\\nconsole.log(a + b);\",\n \"language_id\": 63,\n \"stdin\": \"999999\\n1\",\n \"expected_output\": \"1000000\"\n }\n ]\n}"
}
}
},
{
"name": "C - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"#include <stdio.h>\\nint main() {\\n int a, b;\\n scanf(\\\"%d\\\", &a);\\n scanf(\\\"%d\\\", &b);\\n printf(\\\"%d\\\\n\\\", a + b);\\n return 0;\\n}\",\n \"language_id\": 50,\n \"stdin\": \"1\\n2\",\n \"expected_output\": \"3\"\n },\n {\n \"source_code\": \"#include <stdio.h>\\nint main() {\\n int a, b;\\n scanf(\\\"%d\\\", &a);\\n scanf(\\\"%d\\\", &b);\\n printf(\\\"%d\\\\n\\\", a + b);\\n return 0;\\n}\",\n \"language_id\": 50,\n \"stdin\": \"0\\n0\",\n \"expected_output\": \"0\"\n },\n {\n \"source_code\": \"#include <stdio.h>\\nint main() {\\n int a, b;\\n scanf(\\\"%d\\\", &a);\\n scanf(\\\"%d\\\", &b);\\n printf(\\\"%d\\\\n\\\", a + b);\\n return 0;\\n}\",\n \"language_id\": 50,\n \"stdin\": \"-5\\n5\",\n \"expected_output\": \"0\"\n },\n {\n \"source_code\": \"#include <stdio.h>\\nint main() {\\n int a, b;\\n scanf(\\\"%d\\\", &a);\\n scanf(\\\"%d\\\", &b);\\n printf(\\\"%d\\\\n\\\", a + b);\\n return 0;\\n}\",\n \"language_id\": 50,\n \"stdin\": \"100\\n200\",\n \"expected_output\": \"300\"\n },\n {\n \"source_code\": \"#include <stdio.h>\\nint main() {\\n int a, b;\\n scanf(\\\"%d\\\", &a);\\n scanf(\\\"%d\\\", &b);\\n printf(\\\"%d\\\\n\\\", a + b);\\n return 0;\\n}\",\n \"language_id\": 50,\n \"stdin\": \"-10\\n-20\",\n \"expected_output\": \"-30\"\n },\n {\n \"source_code\": \"#include <stdio.h>\\nint main() {\\n int a, b;\\n scanf(\\\"%d\\\", &a);\\n scanf(\\\"%d\\\", &b);\\n printf(\\\"%d\\\\n\\\", a + b);\\n return 0;\\n}\",\n \"language_id\": 50,\n \"stdin\": \"999999\\n1\",\n \"expected_output\": \"1000000\"\n }\n ]\n}"
}
}
},
{
"name": "C++ - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int a, b;\\n cin >> a >> b;\\n cout << a + b << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"1\\n2\",\n \"expected_output\": \"3\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int a, b;\\n cin >> a >> b;\\n cout << a + b << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"0\\n0\",\n \"expected_output\": \"0\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int a, b;\\n cin >> a >> b;\\n cout << a + b << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"-5\\n5\",\n \"expected_output\": \"0\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int a, b;\\n cin >> a >> b;\\n cout << a + b << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"100\\n200\",\n \"expected_output\": \"300\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int a, b;\\n cin >> a >> b;\\n cout << a + b << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"-10\\n-20\",\n \"expected_output\": \"-30\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int a, b;\\n cin >> a >> b;\\n cout << a + b << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"999999\\n1\",\n \"expected_output\": \"1000000\"\n }\n ]\n}"
}
}
},
{
"name": "Java - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"import java.util.Scanner;\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int a = sc.nextInt();\\n int b = sc.nextInt();\\n System.out.println(a + b);\\n }\\n}\",\n \"language_id\": 62,\n \"stdin\": \"1\\n2\",\n \"expected_output\": \"3\"\n },\n {\n \"source_code\": \"import java.util.Scanner;\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int a = sc.nextInt();\\n int b = sc.nextInt();\\n System.out.println(a + b);\\n }\\n}\",\n \"language_id\": 62,\n \"stdin\": \"0\\n0\",\n \"expected_output\": \"0\"\n },\n {\n \"source_code\": \"import java.util.Scanner;\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int a = sc.nextInt();\\n int b = sc.nextInt();\\n System.out.println(a + b);\\n }\\n}\",\n \"language_id\": 62,\n \"stdin\": \"-5\\n5\",\n \"expected_output\": \"0\"\n },\n {\n \"source_code\": \"import java.util.Scanner;\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int a = sc.nextInt();\\n int b = sc.nextInt();\\n System.out.println(a + b);\\n }\\n}\",\n \"language_id\": 62,\n \"stdin\": \"100\\n200\",\n \"expected_output\": \"300\"\n },\n {\n \"source_code\": \"import java.util.Scanner;\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int a = sc.nextInt();\\n int b = sc.nextInt();\\n System.out.println(a + b);\\n }\\n}\",\n \"language_id\": 62,\n \"stdin\": \"-10\\n-20\",\n \"expected_output\": \"-30\"\n },\n {\n \"source_code\": \"import java.util.Scanner;\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int a = sc.nextInt();\\n int b = sc.nextInt();\\n System.out.println(a + b);\\n }\\n}\",\n \"language_id\": 62,\n \"stdin\": \"999999\\n1\",\n \"expected_output\": \"1000000\"\n }\n ]\n}"
}
}
}
]
},
{
"name": "Problem 2: FizzBuzz",
"description": "Given a number N, print numbers from 1 to N.\nFor multiples of 3 print 'Fizz', for multiples of 5 print 'Buzz',\nfor multiples of both print 'FizzBuzz'.",
"item": [
{
"name": "Python - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"n = int(input())\\nfor i in range(1, n + 1):\\n if i % 15 == 0:\\n print('FizzBuzz')\\n elif i % 3 == 0:\\n print('Fizz')\\n elif i % 5 == 0:\\n print('Buzz')\\n else:\\n print(i)\",\n \"language_id\": 71,\n \"stdin\": \"5\",\n \"expected_output\": \"1\\n2\\nFizz\\n4\\nBuzz\"\n },\n {\n \"source_code\": \"n = int(input())\\nfor i in range(1, n + 1):\\n if i % 15 == 0:\\n print('FizzBuzz')\\n elif i % 3 == 0:\\n print('Fizz')\\n elif i % 5 == 0:\\n print('Buzz')\\n else:\\n print(i)\",\n \"language_id\": 71,\n \"stdin\": \"15\",\n \"expected_output\": \"1\\n2\\nFizz\\n4\\nBuzz\\nFizz\\n7\\n8\\nFizz\\nBuzz\\n11\\nFizz\\n13\\n14\\nFizzBuzz\"\n },\n {\n \"source_code\": \"n = int(input())\\nfor i in range(1, n + 1):\\n if i % 15 == 0:\\n print('FizzBuzz')\\n elif i % 3 == 0:\\n print('Fizz')\\n elif i % 5 == 0:\\n print('Buzz')\\n else:\\n print(i)\",\n \"language_id\": 71,\n \"stdin\": \"1\",\n \"expected_output\": \"1\"\n },\n {\n \"source_code\": \"n = int(input())\\nfor i in range(1, n + 1):\\n if i % 15 == 0:\\n print('FizzBuzz')\\n elif i % 3 == 0:\\n print('Fizz')\\n elif i % 5 == 0:\\n print('Buzz')\\n else:\\n print(i)\",\n \"language_id\": 71,\n \"stdin\": \"3\",\n \"expected_output\": \"1\\n2\\nFizz\"\n },\n {\n \"source_code\": \"n = int(input())\\nfor i in range(1, n + 1):\\n if i % 15 == 0:\\n print('FizzBuzz')\\n elif i % 3 == 0:\\n print('Fizz')\\n elif i % 5 == 0:\\n print('Buzz')\\n else:\\n print(i)\",\n \"language_id\": 71,\n \"stdin\": \"10\",\n \"expected_output\": \"1\\n2\\nFizz\\n4\\nBuzz\\nFizz\\n7\\n8\\nFizz\\nBuzz\"\n }\n ]\n}"
}
}
},
{
"name": "C++ - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int n;\\n cin >> n;\\n for (int i = 1; i <= n; i++) {\\n if (i % 15 == 0) cout << \\\"FizzBuzz\\\" << endl;\\n else if (i % 3 == 0) cout << \\\"Fizz\\\" << endl;\\n else if (i % 5 == 0) cout << \\\"Buzz\\\" << endl;\\n else cout << i << endl;\\n }\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"5\",\n \"expected_output\": \"1\\n2\\nFizz\\n4\\nBuzz\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int n;\\n cin >> n;\\n for (int i = 1; i <= n; i++) {\\n if (i % 15 == 0) cout << \\\"FizzBuzz\\\" << endl;\\n else if (i % 3 == 0) cout << \\\"Fizz\\\" << endl;\\n else if (i % 5 == 0) cout << \\\"Buzz\\\" << endl;\\n else cout << i << endl;\\n }\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"15\",\n \"expected_output\": \"1\\n2\\nFizz\\n4\\nBuzz\\nFizz\\n7\\n8\\nFizz\\nBuzz\\n11\\nFizz\\n13\\n14\\nFizzBuzz\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int n;\\n cin >> n;\\n for (int i = 1; i <= n; i++) {\\n if (i % 15 == 0) cout << \\\"FizzBuzz\\\" << endl;\\n else if (i % 3 == 0) cout << \\\"Fizz\\\" << endl;\\n else if (i % 5 == 0) cout << \\\"Buzz\\\" << endl;\\n else cout << i << endl;\\n }\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"1\",\n \"expected_output\": \"1\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int n;\\n cin >> n;\\n for (int i = 1; i <= n; i++) {\\n if (i % 15 == 0) cout << \\\"FizzBuzz\\\" << endl;\\n else if (i % 3 == 0) cout << \\\"Fizz\\\" << endl;\\n else if (i % 5 == 0) cout << \\\"Buzz\\\" << endl;\\n else cout << i << endl;\\n }\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"3\",\n \"expected_output\": \"1\\n2\\nFizz\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nint main() {\\n int n;\\n cin >> n;\\n for (int i = 1; i <= n; i++) {\\n if (i % 15 == 0) cout << \\\"FizzBuzz\\\" << endl;\\n else if (i % 3 == 0) cout << \\\"Fizz\\\" << endl;\\n else if (i % 5 == 0) cout << \\\"Buzz\\\" << endl;\\n else cout << i << endl;\\n }\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"10\",\n \"expected_output\": \"1\\n2\\nFizz\\n4\\nBuzz\\nFizz\\n7\\n8\\nFizz\\nBuzz\"\n }\n ]\n}"
}
}
}
]
},
{
"name": "Problem 3: Factorial",
"description": "Given a non-negative integer N, return N! (factorial).",
"item": [
{
"name": "Python - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"def factorial(n):\\n if n <= 1:\\n return 1\\n return n * factorial(n - 1)\\n\\nn = int(input())\\nprint(factorial(n))\",\n \"language_id\": 71,\n \"stdin\": \"0\",\n \"expected_output\": \"1\"\n },\n {\n \"source_code\": \"def factorial(n):\\n if n <= 1:\\n return 1\\n return n * factorial(n - 1)\\n\\nn = int(input())\\nprint(factorial(n))\",\n \"language_id\": 71,\n \"stdin\": \"1\",\n \"expected_output\": \"1\"\n },\n {\n \"source_code\": \"def factorial(n):\\n if n <= 1:\\n return 1\\n return n * factorial(n - 1)\\n\\nn = int(input())\\nprint(factorial(n))\",\n \"language_id\": 71,\n \"stdin\": \"5\",\n \"expected_output\": \"120\"\n },\n {\n \"source_code\": \"def factorial(n):\\n if n <= 1:\\n return 1\\n return n * factorial(n - 1)\\n\\nn = int(input())\\nprint(factorial(n))\",\n \"language_id\": 71,\n \"stdin\": \"10\",\n \"expected_output\": \"3628800\"\n },\n {\n \"source_code\": \"def factorial(n):\\n if n <= 1:\\n return 1\\n return n * factorial(n - 1)\\n\\nn = int(input())\\nprint(factorial(n))\",\n \"language_id\": 71,\n \"stdin\": \"12\",\n \"expected_output\": \"479001600\"\n },\n {\n \"source_code\": \"def factorial(n):\\n if n <= 1:\\n return 1\\n return n * factorial(n - 1)\\n\\nn = int(input())\\nprint(factorial(n))\",\n \"language_id\": 71,\n \"stdin\": \"20\",\n \"expected_output\": \"2432902008176640000\"\n }\n ]\n}"
}
}
},
{
"name": "C++ - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nlong long factorial(int n) {\\n if (n <= 1) return 1;\\n return n * factorial(n - 1);\\n}\\nint main() {\\n int n;\\n cin >> n;\\n cout << factorial(n) << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"0\",\n \"expected_output\": \"1\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nlong long factorial(int n) {\\n if (n <= 1) return 1;\\n return n * factorial(n - 1);\\n}\\nint main() {\\n int n;\\n cin >> n;\\n cout << factorial(n) << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"1\",\n \"expected_output\": \"1\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nlong long factorial(int n) {\\n if (n <= 1) return 1;\\n return n * factorial(n - 1);\\n}\\nint main() {\\n int n;\\n cin >> n;\\n cout << factorial(n) << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"5\",\n \"expected_output\": \"120\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nlong long factorial(int n) {\\n if (n <= 1) return 1;\\n return n * factorial(n - 1);\\n}\\nint main() {\\n int n;\\n cin >> n;\\n cout << factorial(n) << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"10\",\n \"expected_output\": \"3628800\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nlong long factorial(int n) {\\n if (n <= 1) return 1;\\n return n * factorial(n - 1);\\n}\\nint main() {\\n int n;\\n cin >> n;\\n cout << factorial(n) << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"12\",\n \"expected_output\": \"479001600\"\n },\n {\n \"source_code\": \"#include <iostream>\\nusing namespace std;\\nlong long factorial(int n) {\\n if (n <= 1) return 1;\\n return n * factorial(n - 1);\\n}\\nint main() {\\n int n;\\n cin >> n;\\n cout << factorial(n) << endl;\\n return 0;\\n}\",\n \"language_id\": 54,\n \"stdin\": \"20\",\n \"expected_output\": \"2432902008176640000\"\n }\n ]\n}"
}
}
}
]
},
{
"name": "Problem 4: Palindrome Check",
"description": "Given a string, check if it's a palindrome (reads same forwards and backwards).\nOutput 'true' or 'false'.",
"item": [
{
"name": "Python - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"s = input().strip()\\nprint('true' if s == s[::-1] else 'false')\",\n \"language_id\": 71,\n \"stdin\": \"racecar\",\n \"expected_output\": \"true\"\n },\n {\n \"source_code\": \"s = input().strip()\\nprint('true' if s == s[::-1] else 'false')\",\n \"language_id\": 71,\n \"stdin\": \"hello\",\n \"expected_output\": \"false\"\n },\n {\n \"source_code\": \"s = input().strip()\\nprint('true' if s == s[::-1] else 'false')\",\n \"language_id\": 71,\n \"stdin\": \"a\",\n \"expected_output\": \"true\"\n },\n {\n \"source_code\": \"s = input().strip()\\nprint('true' if s == s[::-1] else 'false')\",\n \"language_id\": 71,\n \"stdin\": \"abba\",\n \"expected_output\": \"true\"\n },\n {\n \"source_code\": \"s = input().strip()\\nprint('true' if s == s[::-1] else 'false')\",\n \"language_id\": 71,\n \"stdin\": \"abcd\",\n \"expected_output\": \"false\"\n },\n {\n \"source_code\": \"s = input().strip()\\nprint('true' if s == s[::-1] else 'false')\",\n \"language_id\": 71,\n \"stdin\": \"madam\",\n \"expected_output\": \"true\"\n }\n ]\n}"
}
}
},
{
"name": "JavaScript - All Test Cases",
"request": {
"method": "POST",
"url": "{{baseUrl}}/submissions/batch",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"body": {
"mode": "raw",
"raw": "{\n \"submissions\": [\n {\n \"source_code\": \"const fs = require('fs');\\nconst s = fs.readFileSync(0, 'utf8').trim();\\nconsole.log(s === s.split('').reverse().join('') ? 'true' : 'false');\",\n \"language_id\": 63,\n \"stdin\": \"racecar\",\n \"expected_output\": \"true\"\n },\n {\n \"source_code\": \"const fs = require('fs');\\nconst s = fs.readFileSync(0, 'utf8').trim();\\nconsole.log(s === s.split('').reverse().join('') ? 'true' : 'false');\",\n \"language_id\": 63,\n \"stdin\": \"hello\",\n \"expected_output\": \"false\"\n },\n {\n \"source_code\": \"const fs = require('fs');\\nconst s = fs.readFileSync(0, 'utf8').trim();\\nconsole.log(s === s.split('').reverse().join('') ? 'true' : 'false');\",\n \"language_id\": 63,\n \"stdin\": \"a\",\n \"expected_output\": \"true\"\n },\n {\n \"source_code\": \"const fs = require('fs');\\nconst s = fs.readFileSync(0, 'utf8').trim();\\nconsole.log(s === s.split('').reverse().join('') ? 'true' : 'false');\",\n \"language_id\": 63,\n \"stdin\": \"abba\",\n \"expected_output\": \"true\"\n },\n {\n \"source_code\": \"const fs = require('fs');\\nconst s = fs.readFileSync(0, 'utf8').trim();\\nconsole.log(s === s.split('').reverse().join('') ? 'true' : 'false');\",\n \"language_id\": 63,\n \"stdin\": \"abcd\",\n \"expected_output\": \"false\"\n },\n {\n \"source_code\": \"const fs = require('fs');\\nconst s = fs.readFileSync(0, 'utf8').trim();\\nconsole.log(s === s.split('').reverse().join('') ? 'true' : 'false');\",\n \"language_id\": 63,\n \"stdin\": \"madam\",\n \"expected_output\": \"true\"\n }\n ]\n}"
}
}
}
]
},
{
"name": "Utilities",
"item": [
{
"name": "Get Batch Results",
"request": {
"method": "GET",
"url": {
"raw": "{{baseUrl}}/submissions/batch?tokens=token1,token2,token3",
"host": ["{{baseUrl}}"],
"path": ["submissions", "batch"],
"query": [
{ "key": "tokens", "value": "token1,token2,token3" }
]
},
"description": "Replace tokens with actual tokens from batch submission response"
}
},
{
"name": "Get Single Result",
"request": {
"method": "GET",
"url": "{{baseUrl}}/submissions/:token",
"description": "Replace :token with actual token"
}
}
]
}
]
}