Skip to content

Commit e3f8785

Browse files
authored
Create convert-date-to-binary.py
1 parent 6bc9172 commit e3f8785

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Python/convert-date-to-binary.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Time: O(1)
2+
# Space: O(1)
3+
4+
# string
5+
class Solution(object):
6+
def convertDateToBinary(self, date):
7+
"""
8+
:type date: str
9+
:rtype: str
10+
"""
11+
return "-".join(map(lambda x: bin(int(x))[2:], date.split('-')))

0 commit comments

Comments
 (0)