Post Reply 
HHC 2016 RPL Programming Contest (HP-71B)
09-25-2016, 08:11 AM
Post: #2
RE: HHC 2016 RPL Programming Contest (HP-71B)
(09-22-2016 10:58 PM)Valentin Albillo Wrote:  ... I've also produced another 50-byte solution (same length) which uses no string variable (S$), just the numeric variables I (for the index) and M (to keep track of the maximum distance).

See if you can fathom how it's done (quite simple actually) ! 8-D

Hi Valentin,

As always, your HP-71B solutions are compact, efficient ... and amazing!
For your 'nano-challenge' without string variable, may I suggest this way:

1 M=0 @ FOR I=1 TO LEN(DISP$) @ M=MAX(M,I-POS(DISP$,DISP$[I,I])) @ NEXT I @ DISP M

To use it, type the string, DON'T press ENTER but RUN:

>HIPPOPOTAMUS [RUN, not ENTER !]
3
>pablitoclavounclavito [RUN]
15

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2016 RPL Programming Contest (HP-71B) - J-F Garnier - 09-25-2016 08:11 AM



User(s) browsing this thread: 1 Guest(s)