DDSA
Advertisement

2579. Count Total Number of Colored Cells

2579.cs
C#
public class Solution
{
    public long ColoredCells(int n)
    {
        return 1L * n * n + 1L * (n - 1) * (n - 1);
    }
}
Advertisement
Was this solution helpful?