• + 0 comments
    function saveThePrisoner(prisoners, candies, start) {
        // Write your code here
        let lastPrisoner = (start + candies - 1) % prisoners; 
        return lastPrisoner ? lastPrisoner : prisoners; 
    }