Problem · Math

Triple-Position Alphabet Encoding

Learn this problem
EasyArm logoArmNEW GRADOA

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) → String

Examples

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 problems

drafts saved locally
public String encodeTriplePosition(int value) {
    // Write your solution here.
}
value1
expected"C"
checking account