leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
3280.cpp (308B)
0 class Solution { 1 public: 2 string convertDateToBinary(const string &date) const { 3 const auto year = stoi(date.substr(0, 4)); 4 const auto month = stoi(date.substr(5, 2)); 5 const auto day = stoi(date.substr(8, 2)); 6 7 return format("{:b}-{:b}-{:b}", year, month, day); 8 } 9 };