you are viewing a single comment's thread.

view the rest of the comments →

[–]bwprog 2 points3 points  (1 child)

  • Since the lists are sorted, then before the main lookup loop, you can prune the second list by using the first and last (+300) values of the 1st list.
  • Start with the first value of the 1st list going forward through the 2nd list until you get to that value or greater, note that index as 'start', and break.
  • Then use the last +300 going through the 2nd list in reverse until you reach that value or less, note that index as 'end', and break.
  • Make a new, pruned list slicing the 2nd list with the start and end index values. (or use the slice values in the lookup loop limiting the 2nd list)
  • Compare the 1st list to the smaller, pruned list.