Xyz has Russian dolls where small size dolls can fit into large size dolls. No, doll of similar sizes can fit into each other for example doll of size 2 and will only fit into doll of size 3 or bigger than. that and if a doll has already doll of smaller size it can't take another doll of same size. for ex - if doll of size has a doll of size 2 in it already it won't take another size two doll.
You have to take ab array of sizes of doll and provide the output of the remaining doll.
sample inputs are :-
4 (number of dolls)
2,2,3,3(sizes of doll)
3,3(remaining dolls)
as both doll of size 2 will go into size 3 doll so remaining dolls are 3,3 as they can't go.into each other.
Sample input 2 -
6
1,2,2,3,4,5
2,5
explanation - 1 will go in 2, 2 will go in three , 3 will go in 4 and 4 in 5.
As they already have a two.
the remaining dolls will of size 2,5.