CoolFace
Datasetpublic

FPEvalDataset/LeetCodeProblem

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes302downloads
1{2    "id": 3468,3    "name": "find_the_encrypted_string",4    "difficulty": "Easy",5    "link": "https://leetcode.com/problems/find-the-encrypted-string/",6    "date": "2024-06-30 00:00:00",7    "task_description": "You are given a string `s` and an integer `k`. Encrypt the string using the following algorithm: For each character `c` in `s`, replace `c` with the `kth` character after `c` in the string (in a cyclic manner). Return the _encrypted string_. **Example 1:** **Input:** s = \"dart\", k = 3 **Output:** \"tdar\" **Explanation:** For `i = 0`, the 3rd character after `'d'` is `'t'`. For `i = 1`, the 3rd character after `'a'` is `'d'`. For `i = 2`, the 3rd character after `'r'` is `'a'`. For `i = 3`, the 3rd character after `'t'` is `'r'`. **Example 2:** **Input:** s = \"aaa\", k = 1 **Output:** \"aaa\" **Explanation:** As all the characters are the same, the encrypted string will also be the same. **Constraints:** `1 <= s.length <= 100` `1 <= k <= 104` `s` consists only of lowercase English letters.",8    "public_test_cases": [9        {10            "label": "Example 1",11            "input": "s = \"dart\", k = 3",12            "output": "\"tdar\" "13        },14        {15            "label": "Example 2",16            "input": "s = \"aaa\", k = 1",17            "output": "\"aaa\" "18        }19    ],20    "private_test_cases": [21        {22            "input": [23                "\"rbbuoygmhvmavtzmldkjebyivpuowhrivdwbptxxrmio\"",24                774125            ],26            "output": "miorbbuoygmhvmavtzmldkjebyivpuowhrivdwbptxxr"27        },28        {29            "input": [30                "\"hvhqfefrfsrrnzulrpiwithkpxofnpkulntdhbinzhxqyxkmnffmqytnvoxb\"",31                279832            ],33            "output": "inzhxqyxkmnffmqytnvoxbhvhqfefrfsrrnzulrpiwithkpxofnpkulntdhb"34        },35        {36            "input": [37                "\"zgbvjxqqdqvlqgggyblhcdukedgcayseoppquyjrtrwzclevblddphqzhkozxqe\"",38                410939            ],40            "output": "ggyblhcdukedgcayseoppquyjrtrwzclevblddphqzhkozxqezgbvjxqqdqvlqg"41        },42        {43            "input": [44                "\"nxwxpleawbsjapojgdy\"",45                335246            ],47            "output": "wbsjapojgdynxwxplea"48        },49        {50            "input": [51                "\"dwratwxwsycospwwsvgyapifwgxqsekzkgguhqnlcclmnthlcbebbnoprqjacebuzgzxwkw\"",52                710353            ],54            "output": "atwxwsycospwwsvgyapifwgxqsekzkgguhqnlcclmnthlcbebbnoprqjacebuzgzxwkwdwr"55        },56        {57            "input": [58                "\"xxdstahykrysrgeqhhttsaqfqbwfpdgtymrfxnmkotfswvpzzphhwwjbpfrkgilove\"",59                32860            ],61            "output": "vexxdstahykrysrgeqhhttsaqfqbwfpdgtymrfxnmkotfswvpzzphhwwjbpfrkgilo"62        },63        {64            "input": [65                "\"rezrxaokhzkrvtkbmezlcqwjfxbaeeaafdwxzffckzmvshncjipexriwcqnffkbprae\"",66                772767            ],68            "output": "wjfxbaeeaafdwxzffckzmvshncjipexriwcqnffkbpraerezrxaokhzkrvtkbmezlcq"69        },70        {71            "input": [72                "\"hftlmhlrdtkfmlzukcyazjbglrizzhyhupqzxyybtiiddsgzhfqhavqacrlimfhusrrgarplrqwr\"",73                641774            ],75            "output": "pqzxyybtiiddsgzhfqhavqacrlimfhusrrgarplrqwrhftlmhlrdtkfmlzukcyazjbglrizzhyhu"76        },77        {78            "input": [79                "iurvokhadhprgjlpdase",80                401281            ],82            "output": "gjlpdaseiurvokhadhpr"83        },84        {85            "input": [86                "zlodkbooipzfdfoflitcduiqcbxphftkmcpphnshpldvtad",87                309188            ],89            "output": "hnshpldvtadzlodkbooipzfdfoflitcduiqcbxphftkmcpp"90        }91    ],92    "haskell_template": "getEncryptedString :: String -> Int -> String\ngetEncryptedString s k ",93    "ocaml_template": "let getEncryptedString (s: string) (k: int) : string =  ",94    "scala_template": "def getEncryptedString(s: String,k: Int): String = { \n    \n}",95    "java_template": "class Solution {\n    public String getEncryptedString(String s, int k) {\n        \n    }\n}",96    "python_template": "class Solution(object):\n    def getEncryptedString(self, s, k):\n        \"\"\"\n        :type s: str\n        :type k: int\n        :rtype: str\n        \"\"\"\n        "97}