Tap here to switch tabs
Problem
Submissions

Problem: Convert Date to Binary

Convert Date to Binary takes a Gregorian date string and asks you to return its year, month, and day as binary numbers without leading zeros, separated by hyphens.

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 1st1^{ {st}}, 19001900 and Dec 31st31^{ {st}}, 21002100 (both inclusive).

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Convert Date to Binary

Convert Date to Binary takes a Gregorian date string and asks you to return its year, month, and day as binary numbers without leading zeros, separated by hyphens.

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 1st1^{ {st}}, 19001900 and Dec 31st31^{ {st}}, 21002100 (both inclusive).