See More

class Solution { public List getRow(int n) { List tri = new ArrayList(); int i=0; while(i0; j--) tri.set(j, tri.get(j)+tri.get(j-1)); // tri[j]<- tri[j]+tri[j-1] i++; } return tri; } }