-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|