Pattern practice problem

I have a problem in pattern practice question number 8

Hey Adish, Share your problem’s and code’s link also.