please list solution in Java/ C#/C++
given a string s give the minimum amount of substrings without repeaing characters, for example
"word" the answer will be 1 as "word" dont have any duplicate
"dddd" the answer will be 4 as we can only form "d" "d" "d" "d"
"cycle" the answer will be 2 as we can make "cy" "cle"
frog game - given an array blocks where each cell represents the height of the current block, we have two frogs starting on the same block (what ever block) . The frog can only jump to another adjacent block if it is higher or equal to the one she is on. return the max distance that can be between the two frogs if they can start together on any block, for example:
[9,2,5,3,0] the answer will be 2, let the two frogs start on cell 4 and one of them go to cell 2. ( there is another option here that will give you 2)
[1,2,3,4,5,8] the answer will be 6, if both frogs starts at cell 5.