listof(‘2023-02-01’,‘2023-02-02’,‘2023-02-04’,‘2023-02-06’)
private fun isConsecutive(dates: List<String>): Boolean {
if (dates.isEmpty())
return false
for (i in 0 until dates.size - 1) {
val diff = ChronoUnit.DAYS.between(LocalDate.parse(dates[i]), LocalDate.parse(dates[i + 1]))
if (diff != 1L) {
return false
}
}
return true
}