title: How to find the best number of integers with fewer repeated values sequentially in Python
body: <pre><code>A = [7, 3, 7, 3, 1, 3, 4, 1]
  </code></pre>
  <blockquote>
  <p>I have a variable containing a list of integers. These integers show the location,</p>
  </blockquote>
  <p>7 = USA</p>
  <p>3 = UAE</p>
  <p>1 = India</p>
  <p>4 = Pakistan</p>
  <p>If I have five location to visit in each day, how do I get the best five days in sequence for less repetition? </p>
  <p>For example, I want the output array of [7,3,1,3,4] from 7 to 4 these 5 locations are most unique just 1 repeated from the array sequence, I just get 1 repeated location, which is 3, so dynamically, is it possible to get the output when i change the number of locations?</p>