Numbering the Change in Data in a Branch of a Tree


I have a tree that I need to number when there wil be same value.

See image for a sample input and output data.

Any help is appreciated. Thanks

Hi @Rajeev2

Thank you for responding.

The data in 0,3 is still incorrect. The numbering of change in data should still continue even if it the same with the first one.

looks like this:

[edited to use one less component]

next time please post a Grasshopper (12.1 KB)