add qnikst`s solution

+ fix access violation error found by anonymous
+ speedup fix (remote length check)
+ Speedup calculate length of the in strict only if required and cache
  result
add one more test
better output
add mix-mix`s solution