K reverse doubt

Please debug my code:

You are using a wrong approach for the k_reverse function, try to use some other logic .