智能中间件驱动的跨平台设备通信技术解析
2026/5/8 1:35:29
class Solution { public: // Encodes a URL to a shortened URL. string encode(string longUrl) { for(int i=0;i<longUrl.size();i++){ longUrl[i]^=12; } return longUrl; } // Decodes a shortened URL to its original URL. string decode(string shortUrl) { for(int i=0;i<shortUrl.size();i++){ shortUrl[i]^=12; } } }; // Your Solution object will be instantiated and called as such: // Solution solution; // solution.decode(solution.encode(url));异或‘^’可以对地址进行加密操作。