given a word, print its index, words can be increased accordingly

前端 未结 5 1461
南方客
南方客 2021-02-04 06:26

Imagine an alphabet of words.

Example:

 a ==> 1 
 b ==> 2 
 c ==> 3 

 z ==> 26 
 ab ==> 27 
 ac ==> 28 

 az ==> 51 
 bc ==> 52         


        
5条回答
  •  迷失自我
    2021-02-04 06:53

    Base 26 numbering system. I would suggest you look at octal, decimal and hexadecimal numbering systems once you understand how to figure out convert any of them to decimal you will know this one too.

提交回复
热议问题