Revision d8ac8e2c-b921-46a3-94d2-a93dfdd66a4d - Code Golf Stack Exchange
<h1>Count how many months are having a full 31 days and are having less
by counting knuckles</h1>
How many of you that still use your own knuckle to determine whether a month is having a full 31 days or less?
You job is to write a program to count how many months, in a month range, are having a full 31 days and how many are having less than 31 days by "counting the knuckles".
[![Counting days of month by knuckles][1]][1]
*Courtesy: amsi.org.au*
<hr>
<h2>Input</h2>
- A range of month separated by comma:
`min,max`
Where `min` or `max` is a 4 digit year followed by 2 digit month.
Year is from 0001 to 9999. Month is, obviously, from 01 to 12.
Example: `201703,201902` — March 2017 to February 2019
<h2>Output</h2>
- `num_of_knuckles,num_of_grooves`
Example: `14,10` — 14 knuckles, 10 grooves (it means that in that month range we have 14 months that have a full 31 days, and 10 months that have less than 31 days).
<h2>Requirements</h2>
- Do not count if `min` is bigger than `max`, e.g. Input: `201612,201611`.
Just give output `0,0`.
<h2>Examples of input and output</h2>
| Input | Output |
|---------------|-------------|
| 201703,201902 | 14,10 |
| 201701,202008 | 26,18 |
| 000101,999912 | 69993,49995 |
| 201802,201803 | 1,1 |
| 201601,201601 | 1,0 |
| 201612,201611 | 0,0 |
<h2>Rules</h2>
- You may choose any language you like
- One input per line
- This is [tag:code-golf], so shortest code in bytes wins!
- The winner will be chosen in April 9
- PS: this is my first question in PCG, it might have some inconsistencies. Feel free to edit and confirm what's unclear for you.
[1]: https://i.sstatic.net/QtCaU.png