title: Get random element and remove it
body: <p>Problem: I need to get a random element for a container and also delete it from that container. Container does not need to be sorted. <strong>I dont care about the order.</strong></p>
  
  <ul>
  <li>Vector can get me random element in <code>O(1)</code> but delete it only in <code>O(N)</code></li>
  <li>List deletes element in <code>O(1)</code> but can only get random element in <code>O(N)</code></li>
  </ul>
  
  <p>So I came up with an idea of making a custom vector that allow you to remove any element by its index with <code>O(1)+</code> complexity. 
  The idea is to swap the last element and an element you want to remove and then <code>pop_back()</code>. 
  If you need to remove the last elemtent - just <code>pop_back()</code>.
  The order of the vector will not be the same but you get a fast remove method. </p>
  
  <p>As i can understand deque have slower access by index and worse removal complexity then my solution but im not 100% sure.</p>
  
  <p>I'm curious are there data structures that have random access and element removal in <code>O(1)</code> or <code>O(logN)</code> by index or mb by value ?</p>