K31

Pascal's Triangle

Junior Level Candidate
Target Time: 15 - 20 Minutes
Type: ARRAY

Problem Statement & Objective

Given an integer numRows, return the first numRows of Pascal's triangle.

Function Signature (Python)

pascals_triangle(row_index: int) -> list[int]

Input & Output Contract

Output Rule:Satırdaki sayıların tam sayı listesi.

System Constraints

0 <= satir_indeksi <= 33

Example Execution Walkthrough

satir_indeksi = 3 -> [1, 3, 3, 1]
satir_indeksi = 0 -> [1]

Example Test Scenarios (3)

Example 1: Satır 3
Input:[3]
Expected Output:[1,3,3,1]
Example 2: Satır 0
Input:[0]
Expected Output:[1]
Example 3: Satır 1
Input:[1]
Expected Output:[1,1]
Loading Python Editor...
Input Parameters
[
  3
]
Expected Output
[
  1,
  3,
  3,
  1
]