For example if we have two strings "abc" and "1234" i want result "abc4" (the first string masks second). (If we draw them vertical it's like a wave comes from left and tuch chars)
"a" "1" "a"
wave -> "b" "2" result "b"
"c" "3" "c"
"4" "4"
I start with this solution with Haskell
slice from to xs = take (to - from + 1) (drop from xs)
merge l1 l2 = if length l2 > length l1
then l1 ++ slice (length l1) (length l2) l2
else l1
Can you please provide some more elegant\compact solutions.