> Write a function that, given a right argument which is an integer array of year numbers greater than or equal to 1752 and less than 4000, returns a result of the same shape as the right argument where 1 indicates that the corresponding year is a leap year (0 otherwise).
No, every 100 years, there's an exception, and every 400 years, there's an exception to that.
It might be a good idea to make yet another exception every 4000 years, but that hasn't been officially adopted yet. Hence the task's upper limit of 3999.
When we designed ⎕DT (date-time conversion) and had settled on left argument numeric codes for various date-time formats (positive for scalars, negative for vectors), I suggested 0 for validation, returning a Boolean result instead of converting.
Furthermore, the vector formats allow omitting trailing elements, with each element having a default value (e.g. the default month is January and the default day is the 1st, with time-of-day elements being 0).
@Adám that was indeed helpful, and since I read it, I can mostly handle the simplest forks and atops. But when the binding operators start coming in, it's no longer obvious to me
¯10⎕DT converts to a format that begins with year and day-of-year, giving us the number of days in the year by getting the day-of-year number for Dec 31.
But it is much easier to construct Feb 29 for each year, and check if valid with 0⎕DT