Tap here to switch tabs
Problem
Submissions

Problem: Convert Date to Binary

med
30 min
Try to solve the Convert Date to Binary problem.

Statement

You are given a string date representing a Gregorian calendar date in the format "yyyy-mm-dd".

Convert the year, month, and day into their respective binary representations without leading zeros, and return the resulting string with each part separated by '-'.

Constraints:

  • date.length =10= 10

  • date[4] ==== date[7] ==== '-', and all other characters in date are digits.

  • The input is generated such that date represents a valid Gregorian calendar date between Jan 1extst1^{ ext{st}}, 19001900 and Dec 31extst31^{ ext{st}}, 21002100 (both inclusive).

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Convert Date to Binary

med
30 min
Try to solve the Convert Date to Binary problem.

Statement

You are given a string date representing a Gregorian calendar date in the format "yyyy-mm-dd".

Convert the year, month, and day into their respective binary representations without leading zeros, and return the resulting string with each part separated by '-'.

Constraints:

  • date.length =10= 10

  • date[4] ==== date[7] ==== '-', and all other characters in date are digits.

  • The input is generated such that date represents a valid Gregorian calendar date between Jan 1extst1^{ ext{st}}, 19001900 and Dec 31extst31^{ ext{st}}, 21002100 (both inclusive).