Skip to content

Commit 981db9d

Browse files
authored
Update 0005-Pascal-Triangle.md
1 parent 7ac625f commit 981db9d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

dsa-solutions/gfg-solutions/0005-Pascal-Triangle.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In this page, we will solve the Pascal Triangle Row problem using different appr
2121

2222
## Problem Description
2323

24-
Given a positive integer N, return the Nth row of Pascal's triangle. Pascal's triangle is a triangular array of the binomial coefficients formed by summing up the elements of the previous row. The elements can be large so return it modulo \(10^9 + 7\).
24+
Given a positive integer N, return the Nth row of Pascal's triangle. Pascal's triangle is a triangular array of the binomial coefficients formed by summing up the elements of the previous row. The elements can be large so return it modulo $\(10^9 + 7\)$.
2525

2626
### Examples
2727

@@ -188,8 +188,9 @@ function nthRowOfPascalTriangle() {
188188

189189
The mathematical approach leverages the properties of binomial coefficients to directly compute each element in the Nth row of Pascal's triangle. The value of the element at the ith position is calculated using the formula:
190190
191-
`Value = (i choose j) = ((i! / (j! * (i - j)!))%1e9+7)`
192-
191+
$\[
192+
\text{Value} = \binom{i}{j} = \frac{i!}{j! \cdot (i - j)!}
193+
\]$
193194
#### Implementation
194195
195196
```jsx live
@@ -412,4 +413,4 @@ These are the two approaches to solve the Pascal's Triangle Row problem. Each ap
412413
- **Solution Link:** [Pascal's Triangle Solution on GeeksforGeeks](https://www.geeksforgeeks.org/problems/pascal-triangle0652/0)
413414
- **Authors GeeksforGeeks Profile:** [Manish Kumar Gupta](https://www.geeksforgeeks.org/user/manishd5hla/)
414415
415-
---
416+
---

0 commit comments

Comments
 (0)