Previous
0 / 15
Module DEMO-33-67DEMO-OOP-33

Pascal Row Builder

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read a row number and print that row of Pascal's triangle.

Input Format

Input is given as whitespace-separated tokens in this order:

  1. requested row number

Output Format

Print the exact report in this order:

  1. Row

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
0
Row: 1
Input: requested row number = 0.
Key calculation(s): values = new int[0 + 1] | values[0] = 1 | "Row: " + line.toString() = "Row: 1".
Output:
Row: 1
Sample #2
Public sample
4
Row: 1 4 6 4 1
Input: requested row number = 4.
Key calculation(s): values = new int[4 + 1] | values[0] = 1 | "Row: " + line.toString() = "Row: 1 4 6 4 1".
Output:
Row: 1 4 6 4 1

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings