Solved First, allocate space in memory for j and N and use | Chegg.com

Responsive image
source