If the numbers 1 - 100 are written in one long string, how many substrings of minimum length 2 can be found with strictly decreasing numbers?
e.g. 12345678910 has three such substrings: 91, 910, 10.
(In reply to solution
by Dej Mar)
I originally found one fewer (i.e. 90) but I found a typo in the 192 byte string (123...99100) I had typed into my program; making that correction I now find 91, as Dej reports. The program looped from left to right, checking each 2-byte, 3-byte, and 4-byte string from each start position.
I notice Charlie posted while I was entering my comment above. My agreement was with Dej' 91. I'll have to take a closer look at Charlie's entry. (ed)
Edited on July 27, 2010, 3:04 pm
Edited on July 27, 2010, 3:05 pm