Need help on how to calculate this time complexity
int func(int n) {
int a = 0;
for (int i = 1; i <= n; ++i) {
for (int j = 0; j <= n - i; ++j) {
for (int k = 0; k <= n - i; ++k) {
for (int o = 1; o <= i; ++o) {
a++;
}
}
}
}
return a;
}
Here is where I got it from, but I am not sure if this is correct and dont know how to continue.
Edit:
I think I made some progress but I am not sure if this is correct.

