• + 1 comment

    In C#

    public static int jumpingOnClouds(List<int> c)
        {
            int jumps = 0;
            int position = 0;
    
            while (position < c.Count - 1)
            {
                if (position + 2 < c.Count && c[position + 2] == 0)
                {
                    position += 2;
                }
                else
                {
                    position += 1;
                }
                jumps++;
            }
    
        return jumps;
    
    }
    

    }