Could we add 0.5 to avoid reiteration and round up when getting the value for a specific color?
Reiteration is prevented by skipping to 2 indexes down if a match is found. I’m not clear on how 0.5 will help here since we are looking at full pairs values
Yes, you're right. I somehow didn't notice you were using i++ and i+=1. Sorry.
The 0.5 comment was regarding Bavesh's step 4, sorry I was not clear.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Could we add 0.5 to avoid reiteration and round up when getting the value for a specific color?
Reiteration is prevented by skipping to 2 indexes down if a match is found. I’m not clear on how 0.5 will help here since we are looking at full pairs values
Yes, you're right. I somehow didn't notice you were using i++ and i+=1.
Sorry.
The 0.5 comment was regarding Bavesh's step 4, sorry I was not clear.