What is a any good algorithm/code to get list of unique values from array and count of its occurrence in array?
ARRAY[expr1, expr2, ...] Constructs a SQL ARRAY literal from the provided expression arguments. All arguments must be of the same type. ARRAY_APPEND(arr, expr) Appends the expression to the array. The ...