Receives array as an input and returns the unique array and also an object whith array items and their occurences