Pascal's Triangle: Follow-up
Lesson 3 of 3 in Coddy's Interview Coding Challenges - Pack VI course.
Challenge
MediumGiven an integer n, return just the n<sup>th</sup> row of the Pascal's triangle. You should treat the triangle as 0-indexed.
Examples:
Input: 0
Expected output: [1]
Input: 1
Expected Output: [1, 1]
Input: 2
Expected Output: [1, 2, 1]
Can you do it in O(n) time complexity?
Try it yourself
#include <stdlib.h>
int* get_pascals_row(int n, int* returnSize) {
// Write code here
}