Triple-Position Alphabet Encoding
Updated
Problem statement
Map the letters A through Z to positions 1 through 26. Given value, compute 3 * value and wrap positions cyclically after 26.
Return the letter at the resulting one-based position. For example, 1 maps to C and 2 maps to F.
Function
encodeTriplePosition(value: int) → StringExamples
Example 1
value = 1return = "C"Three times one is alphabet position 3, which is C.
Example 2
value = 2return = "F"Three times two is alphabet position 6, which is F.
Example 3
value = 9return = "A"Position 27 wraps to position 1, which is A.
Constraints
1 <= value <= 1000
More Arm interview questions
Similar questions at other companies
- Identification Number Check DigitAbridge · OAAbridge interview questions
- Count Substrings With Identical CharactersVirtu Financial · OAVirtu Financial interview questions
- Count Multiples of Three with Two SevensHudson River Trading · OAHudson River Trading interview questions
- Is This Date a Weekend?Salesforce · OASalesforce interview questions
- Closest ColorTwo Sigma · OATwo Sigma interview questions
- Prime Number From a StringAdobe · OAAdobe interview questions
- Sum Integer StringsIntuit · OAIntuit interview questions
- Digit Changes for a Multiple of 9Nutanix · OANutanix interview questions
- Count Times Using at Most Two DigitsLSEG · OALSEG interview questions
- Valid String CheckUber · OAUber interview questions