This commit is contained in:
2025-12-21 21:18:47 +08:00
parent e0912887c2
commit f14466081c
3 changed files with 52 additions and 0 deletions

10
25/12/comp/21q1.cpp Normal file
View File

@@ -0,0 +1,10 @@
#include <string>
class Solution {
public:
int mirrorDistance(int n) {
std::string s = std::to_string(n);
std::reverse(s.begin(),s.end());
return std::abs(n - std::stoi(s));
}
};