Return the number of unique values in s, treating NaN as its own
distinct value (so a Series with two NaN entries counts them as one extra
unique value, not zero).
Sample data:
s:
0 1.0
1 2.0
2 2.0
3 NaN
4 3.0
5 NaN
... (7 rows total)
solve(...)