Algorithm · Optiver · Medium
You receive two calendar dates, date1 and date2, specified as integer year, month, and day values. Since date1 is guaranteed to precede date2, determine how many whole days separate them (date2 - date1). Do not rely on any built-in date or calendar utilities. A helper routine is available: DaysInMonth(month, year): gives the day count for the specified month and year, including proper handling of leap years and varying month sizes. Input (suggested) Provide the dates on two…
Checking your access…