Complete PascalTriangle but still need optimizing;

I thought out the violence solution of WordBreak but the solution failed
on OJ;
MaxPointsOnALine Time Exceed Limit;