package leetcode;

/**
 * https://leetcode.com/problems/number-of-days-between-two-dates/
 */
public class Problem1360 {
    public int daysBetweenDates(String date1, String date2) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1360 prob = new Problem1360();
        System.out.println(prob.daysBetweenDates("2019-06-29", "2019-06-30")); // 1
        System.out.println(prob.daysBetweenDates("2020-01-15", "2019-12-31")); // 15
    }
}

@@ -12,16 +12,83 @@
 tcode;%0A%0A
+import java.time.LocalDate;%0Aimport java.time.temporal.ChronoUnit;%0A%0A
 /**%0A * h
@@ -255,300 +255,505 @@
     
-// TODO%0A        return 0
+String%5B%5D splitDate1 = date1.split(%22-%22);%0A        String%5B%5D splitDate2 = date2.split(%22-%22)
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1360 prob = new Problem1360();%0A        Sys
+LocalDate d1 = LocalDate.of(%0A            Integer.parseInt(splitDate1%5B0%5D),%0A            Integer.parseInt(splitDate1%5B1%5D),%0A            Integer.parseInt(splitDate1%5B2%5D));%0A        LocalDate d2 = LocalDa
 te
-m
 .o
-ut.println(prob.daysBetweenDates(%222019-06-29%22, %222019-06-30%22)); // 1%0A        System.out.println(prob.daysBetweenDates(%222020-01-15%22, %222019-12-31%22)); // 15
+f(%0A            Integer.parseInt(splitDate2%5B0%5D),%0A            Integer.parseInt(splitDate2%5B1%5D),%0A            Integer.parseInt(splitDate2%5B2%5D));%0A        return (int) Math.abs(ChronoUnit.DAYS.between(d1, d2));
 %0A   

Solve problem 1360