May-22-2020, 04:15 PM
It is difficult for someone to diagnose your problem when the only thing you provide is code that doesn't work the way you want. What is it supposed to do? This code would be difficult to analyze even if I knew what it is supposed to do. Names like v, n, d, c, p, j and k don't provide a lot of information. What should the output be? How does your output differ?
If I am forced to guess the first interesting thing I see is:
If I am forced to guess the first interesting thing I see is:
for i in range(n-1)Is n the length of v? If so, the loop does not process the last element in v.