Затруднение със задача 02.Pascal Triangle , Java Fundamentals

Здравейте, имам проблем със задачата Pascal's Triangle от Java Fundamentals. При решение ми дава 83/100, а при въвеждане на примерни данни всичко уж излиза добре.

Ще съм много благодарна за съвети и поправки по кода: https://pastebin.com/hN78ShmV

Благодаря предварително!

Условието е:

2.Pascal Triangle

The triangle may be constructed in the following manner: In row 0 (the topmost row), there is a unique nonzero entry 1. Each entry of each subsequent row is constructed by adding the number above and to the left with the number above and to the right, treating blank entries as 0. For example, the initial number in the first (or any other) row is 1 (the sum of 0 and 1), whereas the numbers 1 and 3 in the third row are added to produce the number 4 in the fourth row.

If you want more info about it: https://en.wikipedia.org/wiki/Pascal's_triangle

Print each row elements separated with whitespace.


  • The input number n will be 1 <= n <= 60
  • Think about proper type for elements in array
  • Don’t be scary to use more and more arrays