The problem: You have 1..n numbers in a n+1 length array. With exactly one duplicate in it. You need to find this duplicate value in O(n) time complexity (i.e with only one iteration) and O(1) space complexity…

1..n

n+1

This was a personal challenge I encountered. If the title is not explanatory enough, this article will run you through collapsible rendering in d3. Now that is something we have already seen . But most of us have seen it in…