title: Efficient way to check if array is binary
body: <p>I have an sparse array of frequencies that is being constantly updated, and I'm trying to check if a duplicate exists after each update. Using the frequency array, I'm attempting to determine whether or not the array contains elements greater than one. Since the array is sparse and very large, it's costly to iterate over the entire array </p>
  
  <p>Is there an efficient way to do this (bit manipulation or some data structure that is efficient for multiple queries like a binary indexed tree)? </p>
  
  <p>EDIT: I'm updating a frequency array so I'm looking for an element greater than zero.</p>