I have a website that allows multiple users to highlight multiple parts of a html document (mostly text).
Each highlight is marked by the start, character position, length and user id.
I need to find out the most highlighted sections (most overlapped sections), however different users might not have the same start and end position. What’s the best way to implement such feature? preferably in c#
Put all the users’ begin and end selections in a list, sorted. Start at the top of the list and increment a counter for each begin point you find, decrement for each end point you find. The highest value of the counter is the start of your most highlighted / most overlapped section of text. The next item in the list is the end of that selection.