Skip to content

Commit

Permalink
2024-11-27
Browse files Browse the repository at this point in the history
  • Loading branch information
jung0115 committed Nov 27, 2024
1 parent adbb1a2 commit 883e84f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion jung0115/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
| 21차시 | 2024.10.23.수 | DFS | [여행경로(Lv.2)](https://school.programmers.co.kr/learn/courses/30/lessons/43164) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/181 |
| 22차시 | 2024.10.30.수 | 브루트포스 | [점 찍기(Lv.2)](https://school.programmers.co.kr/learn/courses/30/lessons/140107) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/182 |
| 23차시 | 2024.11.02.토 | 그리디 알고리즘 | [구명보트(Lv.2)](https://school.programmers.co.kr/learn/courses/30/lessons/42885) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/184 |
| 24처사 | 2024.11.09.토 | 그리디 알고리즘 | [섬 연결하기(Lv.3)](https://school.programmers.co.kr/learn/courses/30/lessons/42861) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/187 |
| 24차시 | 2024.11.09.토 | 그리디 알고리즘 | [섬 연결하기(Lv.3)](https://school.programmers.co.kr/learn/courses/30/lessons/42861) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/187 |
| 25차시 | 2024.11.27.수 | 그리디 알고리즘 | [호텔 대실(Lv.2)](https://school.programmers.co.kr/learn/courses/30/lessons/155651) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/189 |
19 changes: 19 additions & 0 deletions jung0115/그리디알고리즘/Programmers_155651.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 25차시 2024.11.27.수 : 프로그래머스 - 호텔 대실(Lv.2)
import java.util.Arrays

class Solution {
fun solution(book_time: Array<Array<String>>): Int {
val times = IntArray(1440)

for (time in book_time) {
var start = time[0].substring(0, 2).toInt() * 60 + time[0].substring(3, 5).toInt()
var end = time[1].substring(0, 2).toInt() * 60 + time[1].substring(3, 5).toInt()

for (j in start until (end + 10).coerceAtMost(1440)) {
times[j]++
}
}

return times.maxOrNull() ?: 0
}
}
2 changes: 1 addition & 1 deletion jung0115/그리디알고리즘/Programmers_42861.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 프로그래머스 - 섬 연결하기(Lv.3)
# 24차시 2024.11.09.토 : 프로그래머스 - 섬 연결하기(Lv.3)
def solution(n, costs):
answer = 0

Expand Down

0 comments on commit 883e84f

Please sign in to comment.