Can u please tell why my code is not giving correct solution


please give the corrected code

your function shortestchain is of int type but u forgot to return after the while loop ends in line 46