title: Set Slice Membership Algorithm
body: <p>This is a hole in my undergrad CS that I never quite figured out anything beyond a naive approach to.</p>
  
  <p>Say we break a week into minutes (10,080) and we have "shows" that start at some given minute and last for some duration.  </p>
  
  <p>So at say, minute 480, we may have a 30 minute show.</p>
  
  <p>So we have N shows each with a start time and duration and the question is that given some minute value in the range [1..10080] what's a better way of finding if it's within a show then simply naively going through all of them and doing a &lt; and > or a basic tree of start times.</p>
  
  <p>I'm thinking if there's some kind of clever hashing algorithm out there where some other clever membership test can be executed on.  Something that has upfront insertion cost but an effective aggregate O(1) search.  My gut tells me there should be a clever way. </p>
  
  <p>Or, are computers fast enough that the optimal solution is just spinning my wheels and wasting time?</p>