How to remove same subarrays occuring twice

my code

Refer this.