about | help | code help+videos | done | prefs |
(EASY) Given an input String consisting of only uppercase letters, change each letter into a number representing that letter's position in the alphabet and return an ArrayList of Integer values representing those positions. So 'A' becomes 0, 'B' becomes 1, ..., 'Z' becomes 25. HINT: one easy way to do this is with the charAt method of String, which takes an index and returns the char at that index. Also useful: the char data type is a 16-bit integer, which can be assigned directly into a 32-bit int primitive.apcsaEncryptToAlphaNums("ABC") → [0, 1, 2] apcsaEncryptToAlphaNums("XYZ") → [23, 24, 25] apcsaEncryptToAlphaNums("FEEDTHEMETER") → [5, 4, 4, 3, 19, 7, 4, 12, 4, 19, 4, 17] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 310
Copyright Nick Parlante 2017 - privacy