Coding since 11yo, that makes it over 30 years now ~~~
Have a PhD in Comp Sci ~~~
Love to go on bike tours ~~~
I try to stay as generalist as I can in this crazy wide place coding is at now.
First up it converts the array of letters to an array of char codes.
It then uses reduce to find the 2-code gap, and return the letter with char code one less that that of the letter just after the gap.
If there is more than one gap it will return the letter for the last one.
If there is no 2-code gap, then it will return undefined.
A quicky using
reduce
in JSFirst up it converts the array of letters to an array of char codes.
It then uses reduce to find the 2-code gap, and return the letter with char code one less that that of the letter just after the gap.
If there is more than one gap it will return the letter for the last one.
If there is no 2-code gap, then it will return undefined.
(checked on kata)