Given two sorted arrays of int type. There should be returned a merged sorted array without any duplication. The solution should be optimal: no additional sorting or using hash maps.
Example: [11; 15; 17; 20; 21], [-1; 9; 12; 19; 20; 21; 22] --> [-1; 9; 11; 12; 15; 17; 19; 20; 21; 22]
 
Test set 1
Result:
 
Test set 2
Result:
 
Test set 3
Result:
 
Test set 4
Result:
 
Test set 5
Result:
 
Test set 6
Result:
 
Test set 7
Result: