IMO SpeedTests should be described only with regards to their Input-values and the expected Result(s)...
leaving the implementation-language free to choose anything suitable, to produce the result (either elegantly, speedy - or both)...
That said, here's a simple VBScript-implementation for the problem (easy to translate into basically any Basic-Dialect):
Code: Select all
MsgBox FindSolutionFor("LWK3724")
Function FindSolutionFor(S)
FindSolutionFor = (26 ^ 2 * (Asc(Mid(S, 1, 1)) - 65) _
+ 26 ^ 1 * (Asc(Mid(S, 2, 1)) - 65) _
+ 26 ^ 0 * (Asc(Mid(S, 3, 1)) - 65)) _
* 10000 + Mid(S, 4, 4) + 1
End Function