<p>Write a program to count the number of days between two dates.</p>

<p>The two dates are given as strings, their format is <code>YYYY-MM-DD</code>&nbsp;as shown in the examples.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<pre><strong>Input:</strong> date1 = "2019-06-29", date2 = "2019-06-30"
<strong>Output:</strong> 1
</pre><p><strong class="example">Example 2:</strong></p>
<pre><strong>Input:</strong> date1 = "2020-01-15", date2 = "2019-12-31"
<strong>Output:</strong> 15
</pre>
<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li>The given dates are valid&nbsp;dates between the years <code>1971</code> and <code>2100</code>.</li>
</ul>

class Solution:
    def get_feb_days(self, year):
        if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
            return 29 
        else:
            return 28

    def dayOfYear(self, date: str) -> int:
        [year, month, day] = [int(d) for d in date.split('-')]
        days_in_month = [
            31, 
            self.get_feb_days(year), 
            31, 
            30,
            31,
            30, #iun
            31,
            31, #aug
            30,
            31,
            30,
            31
        ]
        return sum(days_in_month[:month-1]) + day

    def daysBetweenDates(self, date1: str, date2: str) -> int:
        [year1, month1, day1] = [int(n) for n in date1.split('-')]
        [year2, month2, day2] = [int(n) for n in date2.split('-')]
        sum1 = 0
        sum2 = 0
        for i in range(1971,year1):
            sum1 += self.dayOfYear(str(i) + "-12-31")
        sum1 += self.dayOfYear(date1)

        for j in range(1971,year2):
            sum2 += self.dayOfYear(str(j) + "-12-31")
        sum2 += self.dayOfYear(date2)

        return abs(sum1-sum2) 



16800