Day of the Programmer
javascript
year return 2017 "13.09.2017" 2016 "12.09.2016" 1800 "12.09.1800"
function dayOfProgrammer(year) { let ret = '13.09.' + year; if (year > 1918) { if (year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0)) { ret = '12.09.' + year; } } else if (year === 1918) { ret = '26.09.' + year; } else { if (year % 4 === 0) { ret = '12.09.' + year; } } return ret; }
출처: hackerrank Algorithms, https://www.hackerrank.com/