# Sherlock's Array Merging Algorithm

# Sherlock's Array Merging Algorithm

+ 2 comments Hi, the solution of the problem are is clearly defined.

I have following confusions,

Why the solution {[1,2],[3]} is not included in first sample case as a solution ? Why the solution {[1],[2]} is not included in second sample case as a solution ?

I would request the author of the problem to include 2 more samples to better understand the solution.

+ 2 comments Do the arrays in the collections have to be sorted?

+ 0 comments I think the solution given is wrong .

For the input n = 4

1 3 2 4The possible V are

A. 1 2 4

3B, 1 2

3 4Hence there are 2 solutions . But the algo mentioned gives 5 as op

+ 0 comments Can you please explain why [{1,2},{3}] is not considered in 1st example and [{1},{2}] not in 2nd?

+ 0 comments Needs to do small optimisations to pass solution with complexity of O(n^3).

Sort 13 Discussions, By:

Please Login in order to post a comment