mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-04 07:29:47 +08:00
style: cleanup PascalTriangle
(#1606)
* tests: add missing tests for `PascalTriangle` * style: remove redundant branch in `generate` * tests: simplify tests of `PascalTriangle`
This commit is contained in:
@ -17,8 +17,6 @@ const generate = (numRows) => {
|
||||
return []
|
||||
} else if (numRows === 1) {
|
||||
return [[1]]
|
||||
} else if (numRows === 2) {
|
||||
return [[1], [1, 1]]
|
||||
} else {
|
||||
for (let i = 2; i < numRows; i++) {
|
||||
addRow(triangle)
|
||||
|
Reference in New Issue
Block a user