title: algorithm to find the shortest subarray with distinct values
body: <p>Given an array A, find a shortest subarray A[i : j ] such that each distinct value present in A is also present in the subarray.</p>
  
  <p>The question is not for a homework. It's a practice problem from a chapter on Hash tables. I am not looking for the code. Just looking for the algorithm or hints.</p>