Type an input and write what you think is the output . Each problem is converted to Web Assembly, so any possible input will show the corresponding output. Only correct predictions count.
Locked until you have predicted 3 outputs correctly.
| 1 | int solution(int rows, int cols) { |
| 2 | |
| 3 | if (rows <= 0 || cols <= 0) { |
| 4 | return 0; |
| 5 | } |
| 6 | |
| 7 | vector<int> row(cols, 1); |
| 8 | |
| 9 | for (int r = 1; r < rows; r++) { |
| 10 | for (int c = 1; c < cols; c++) { |
| 11 | row[c] += row[c - 1]; |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | return row[cols - 1]; |
| 16 | } |
Names have been stripped. The signature is the only clue you get for free. Compiled as C++20 with the standard headers and using namespace std; already in scope.