3468. Find the Encrypted String
My accepted C++ solution to LeetCode problem 3468, Find the Encrypted String, running in 0ms.
- Difficulty: Easy
- C++
- Runtime 0ms
- Memory 9.2MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
C++
Accepted on LeetCode — runtime 0ms, memory 9.2MB, accepted 2025-12-27.
class Solution {
public:
string getEncryptedString(string s, int k) {
int n = s.size();
k %= n;
return s.substr(k) + s.substr(0, k);
}
};