• + 0 comments

    This is my code in C# 🙌

            int counterJumps = 0;
            int counterZero = 0;
    
            for (int i = 0; i < c.Count; i++)
            {
                if (c[i] == 1)
                {
                    counterJumps++;                    
                    counterZero = 0;
                    continue;
                }
                else
                {
                    counterZero++;
                }
    
                if (counterZero == 2)
                {
                    counterJumps++;
                    counterZero = 0;
                }
            }
            return counterJumps;