JAVA_LeetCode 2409_Count Days Spent Together 풀이 class Solution { public int countDaysTogether(String arriveAlice, String leaveAlice, String arriveBob, String leaveBob) { // string의 compareTo를 이용하여 날짜 앞 뒤를 찾고, 값을 비교하여 일을 반환한다. int[] day = new int[]{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int res = 0; String st = arriveAlice.compareTo(arriveBob) > 0 ? arriveAlice : arriveBob; String ed = leaveAlice.compareTo(leaveBob) > 0 ?
leaveBob : leaveAlice; int stMon = Integer.parseInt(st.substri...
#
JAVA
#
JAVA_CountDaysSpentTogether
#
JAVA_LeetCode2409
#
JAVA_LeetCode2409_CountDaysSpentTogether
#
LeetCode2409_CountDaysSpentTogether