This is Pascal’s triangle. Here we can directly simulate it. Use a queue to implement. Note that we need to distinguish the first and the last, because these two numbers are used only once in the addition and modulo operation. Therefore we use -1 as a marker. It indicates that the number before -1 is the last number.