This commit is contained in:
parent
807b1a2d7e
commit
c58936690d
1 changed files with 8 additions and 0 deletions
8
medium/count_total_number_of_colored_cells.py
Normal file
8
medium/count_total_number_of_colored_cells.py
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
# https://leetcode.com/problems/count-total-number-of-colored-cells
|
||||||
|
|
||||||
|
class Solution:
|
||||||
|
def coloredCells(self, n: int) -> int:
|
||||||
|
if n == 1:
|
||||||
|
return 1
|
||||||
|
return (n - 1) ** 2 + n ** 2
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue