Convert alphabet to 26 base + array length

I will post something that was helpful when solving the paiza problem

Convert alphabet to 26-ary (1-26)

S="abcdefghijklmnopqrstuvwxyz" S.index(x)+1 It is converted to a character string up to the 26th with S, and converted to a number depending on the number of the actual alphabet. (There seems to be a better way ...)

Array length

x = [1,2,3,4,5] x.length (=5) (x.length -1) (=4) You can use it even with a short length.

Recommended Posts

Convert alphabet to 26 base + array length
[Java] Convert ArrayList to array
[Java] Convert array to ArrayList * Caution
Convert Swift 2D array to C 2D array
Convert an array of strings to numbers
Convert a string to a character-by-character array with swift
Convert the array of errors.full_messages to characters and output
Convert csv file to fixed length record file using enum
How to convert a file to a byte array in Java
[Java] I want to convert a byte array to a hexadecimal number
Convert a Java byte array to a string in hexadecimal notation
How to add elements without specifying the length of the array
For Java beginners: List, Map, Iterator / Array ... How to convert?
Convert 2D array to csv format with Java 8 Stream API
Convert an array that may be null to a stream
[Ruby] How to batch convert strings in an array to numbers
Convert Java Powerpoint to XPS
I want to convert characters ...
Convert String type to Timestamp type
Convert to Ruby Leet string
Convert Serializable Object to byte []
Convert from ○ months to ○ years ○ months
How to convert Java radix
How to initialize Java array
I want to convert an array to Active Record Relation with Rails
[Ruby] I want to put an array in a variable. I want to convert to an array