Count distinct elements in an array

I have a requirement where I have to find the distinct value in the grid column and display it 

Any suggestion

  Discussion posts and replies are publicly visible