Getting wrong ans or time limit

I used pascal’s triangle for this.
Please tell me the problem with my code. or some other hints.