I am trying to generate pascal's triangle using powers of 11 but it works only till 4 and after 4 code needs to be modified to achieve further part of the triangle. Any leads for the answer(if possible through this method) are appreciated.
class Solution {
public List<List<Integer>> generate(int numRows) {
List<List<Integer>> a = new ArrayList<List<Integer>>();
for (int i = 0; i < numRows; i++) {
List<Integer> b = new ArrayList<Integer>(i);
int c = (int) (Math.pow(11, i));
while (c > 0) {
int d = c % 10;
b.add(d);
c = c / 10;
}
a.add(b);
}
return a;
}
}