Practice Hash Divided String
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Given s and k, where the length of s is divisible by k, split s into consecutive groups of k letters. For each group, assign a = 0 through z = 25, sum these values, and take the remainder modulo 26. Convert that remainder back to a letter. Return the letters for the groups in their original order.
Source: Hash Divided String on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
s = "abcd", k = 2
Output
"bf"
# Example 2
Input
s = "mxz", k = 3
Output
"i"
Constraints
1 <= k <= 100
k <= s.length <= 1000
s.length is divisible by k.
s consists only of lowercase English letters.
Related LeetCode Problems
Practice more problems similar to Hash Divided String.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.