I am trying to implement an algorithm to solve the [Knapsack problem](https://en.wikipedia.org/wiki/Knapsack_problem):

```
cst = 1;

for (j = 0; j < 200; j++) {
    if (kk - cst < 0) {
        continue;
        cst++;
    }

    for (i = kk - cst; i >= 0; --i) {
        C[i + cst] = max(C[i + cst], C[i] + index[cst]);
    }
    cst++;
}

```

The `index` array has the values of respective items represented by index of the array. I want to know where I'm going wrong.