Algorithm · DoorDash · Medium
Given a date-and-time string, determine its Unix timestamp. The incoming value uses the format 'YYYY-MM-DD HH:MM:SS'. Write a function to_unix_timestamp(date_time: str) -> int that performs this conversion and returns the resulting timestamp. Input One date-time string formatted as 'YYYY-MM-DD HH:MM:SS'. Output The matching Unix timestamp as an integer. Example The timestamp is 172800 because this moment occurs two full days after the Unix epoch. Constraints The supplied…
Checking your access…