I found an interesting problem on https://www.codewars.com/kata/5bc5cfc9d38567e29600019d:
## Story

Your company migrated the last 20 years of it's *very important data* to a new platform, in multiple phases. However, something went wrong: some of the essential time-stamps were messed up! It looks like that some servers were set to use the `dd/mm/yyyy` date format, while others were using the `mm/dd/yyyy` format during the migration. Unfortunately, the original database got corrupted in the process and there are no backups available... Now it's up to you to assess the damage.

## Task

You will receive a list of records as strings in the form of `[start_date, end_date]` given in the ISO `yyyy-mm-dd` format, and your task is to count how many of these records are: 
* **correct**: there can be nothing wrong with the dates, the month/day cannot be mixed up, or it would not make a valid timestamp in any other way; e.g. `["2015-04-04", "2015-05-13"]`
* **recoverable**: invalid in its current form, but the original timestamp can be recovered, because there is only one valid combination possible; e.g. `["2011-10-08", "2011-08-14"]`
* **uncertain**: one or both dates are ambiguous, and they may generate multiple valid timestamps, so the original cannot be retrieved; e.g. `["2002-02-07", "2002-12-10"]`

**Note:** the original records always defined a *non-negative* duration

Return your findings in an array: `[ correct_count, recoverable_count, uncertain_count ]`

## Examples

---

## My other katas

If you enjoyed this kata then please try [my other katas](https://www.codewars.com/collections/katas-created-by-anter69)! :-)

I tried it in Python, but could not do it. Can you solve it?
from datetime import date

def less(d1, d2):
    if d1 == None or d2 == None:
        return 0
    
    return 1 if d1 <= d2 else 0

def check_dates(records):
    correct = recoverable = uncertain = 0
    for interval in records:
        start = interval[0].split('-')
        end = interval[1].split('-')
        try:
            start1 = date(int(start[0]), int(start[1].lstrip('0')), int(start[2].lstrip('0')))
        except:
            start1 = None
        try:
            start2 = date(int(start[0]), int(start[2].lstrip('0')), int(start[1].lstrip('0')))
        except:
            start2 = None
        try:
            end1 = date(int(end[0]), int(end[1].lstrip('0')), int(end[2].lstrip('0')))
        except:
            end1 = None
        try:
            end2 = date(int(end[0]), int(end[2].lstrip('0')), int(end[1].lstrip('0')))
        except:
            end2 = None
        
        combinations = less(start1, end1) + less(start1, end2) + less(start2, end1) + less(start2, end2)
        if start1 == start2:
            combinations -= 1
        if end1 == end2:
            combinations -= 1
        if start1 == start2 and end1 == end2:
            combinations -= 1

        if less(start1, end1) == 1 and combinations == 1:
            correct += 1
        elif combinations == 1:
            recoverable += 1
        else:
            uncertain += 1
        
    return [correct, recoverable, uncertain]