Skip to content

Commit

Permalink
2024-04-11
Browse files Browse the repository at this point in the history
  • Loading branch information
kjs254 committed Apr 11, 2024
1 parent b75b28a commit 32426eb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kjs254/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@
| 7μ°¨μ‹œ | 2024.03.01 | κ΅¬ν˜„ | [μΊμ‹œ](https://school.programmers.co.kr/learn/courses/30/lessons/17680) | [#24](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/24) |
| 8μ°¨μ‹œ | 2024.03.08 | κ΅¬ν˜„ | [νŠœν”Œ](https://school.programmers.co.kr/learn/courses/30/lessons/64065) | [#30](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/30) |
| 9μ°¨μ‹œ | 2024.03.10 | κ΅¬ν˜„ | [λ‰΄μŠ€ ν΄λŸ¬μŠ€ν„°λ§](https://school.programmers.co.kr/learn/courses/30/lessons/17677) | [#33](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/33) |
| 10μ°¨μ‹œ | 2024.04.02 | ν•΄μ‹œ | [μ „ν™”λ²ˆν˜Έ λͺ©λ‘](https://school.programmers.co.kr/learn/courses/30/lessons/42577) | [#46](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/46) |
| 11μ°¨μ‹œ | 2024.04.05 | DFS | [νƒ€κ²Ÿ λ„˜λ²„](https://school.programmers.co.kr/learn/courses/30/lessons/43165) | [#47](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/47) |
| 12μ°¨μ‹œ | 2024.04.11 | DFS | [μ•ˆμ „μ§€λŒ€](https://school.programmers.co.kr/learn/courses/30/lessons/120866) | [#50](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/50) |
---
17 changes: 17 additions & 0 deletions kjs254/κ΅¬ν˜„/μ•ˆμ „μ§€λŒ€.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def solution(board):
n = len(board)
for i in range(n):
board[i].insert(0,-1)
board[i].append(-1)
board.insert(0,[-1]*(n+2))
board.append([-1]*(n+2))

for i in range(n+2):
for j in range(n+2):

if board[i][j]==1:
for dx in (-1,0,1):
for dy in (-1,0,1):
board[i+dy][j+dx] = board[i+dy][j+dx]*2 -1

return sum(board, []).count(0)

0 comments on commit 32426eb

Please sign in to comment.