Question: (With C++ program) Implement a function which takes an integer N as the argument, which indicates the function should return a Pascal's triangle up to

PASCAL'S TRIANGLE Implement a function which takes an integer N as the argument, which indicates the function should return a Pascal's triangle up to level N (3sNs20). The return type is an std::vector of std::strings, and the strings should contain a formatted list of numbers from Pascal's triangle. For example, if N=5, your function should return 5 strings like: "1" "11" "1 21" "1 331 "1 4 6 41" 15 35 1" 7 126 126 84 9 1" If N=15, your function should return 15 strings like: "1" "11" "12 1" "1 3 3 1" "1 4 6 4 1" "1 5 10 10 5 1" "1615 20 6 "17 21 35 21 1" "1828 56 70 56 28 8 1" "1 9 36 84 36 "1 10 45 120 210 252 210 120 45 10 1" "1 11 55 165 330 462 462 330 55 11 1" "1 12 66 220 495 792 924 792 495 220 66 12 1" "1 13 78 286 715 1287 1716 1716 1287 715 286 78 13 1" "1 14 91 364 1001 2002 3003 3432 3003 2002 1001 364 91 14 1" Remark: the numbers are always aligned, and the empty spaces are filled to match the largest number in the same column. There should be no additional white space before the first 1 or after the ending 1. Language Mode C/C++ 165 Your Code RESET #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
