Write a C++ program that has a function which given n>=0,
create an array length n*n with the following pattern, shown here
for n=3 : {0, 0, 1, 0, 2, 1, 3, 2, 1} (spaces added
to show the 3 groups)
generateGroups(3) → [0, 0, 1, 0, 2, 1, 3, 2, 1]
generateGroups(2) → [0, 1, 2, 1]
generateGroups(4) → [0, 0, 0, 1, 0, 0, 2, 1, 0, 3, 2, 1, 4, 3,
2, 1]