Premium problem66. Count Unique Colors

Medium Locked

I is an image of shape (h, w, 3). Return the number of unique colors, i.e. the number of distinct RGB triples among all of its pixels.

Input

[[[0 1 2]
  [0 1 2]]

 [[3 3 3]
  [0 1 2]]]

Output

2

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)