leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

1108.cpp (281B)


0 class Solution { 1 public: 2 string defangIPaddr(const string &address) const { 3 string res; 4 5 for (const char c : address) { 6 if (c != '.') 7 res += c; 8 else 9 res += "[.]"; 10 } 11 12 return res; 13 } 14 };