Help me in solving CPPFALL466 problem

My issue

i can’t solve this problem, help me

My code

#include <iostream>
using namespace std;

void printWavePattern(int N) {
    for (int row = 0; row < 2 * N - 1; row++) {
        for (int col = 0; col < N; col++) {
            if (row % (N - 1) == col || row % (N - 1) == N - col - 1) {
                cout << "*";
            } else {
                cout << " ";
            }
            if (col < N - 1) {
                cout << " ";
            }
        }
        cout << endl;
    }
}

int main() {
    int N;
    cin >> N;
    printWavePattern(N);
    return 0;
}

Learning course: Learn Programming and Problem Solving using C++
Problem Link: https://www.codechef.com/learn/course/sit-cpp-fall/SITFALL64/problems/CPPFALL466