title: Nested loop keeps adding the same element multiple times
body: <p>I have 2 <code>arrays</code> which I am getting as a <code>string-array</code> and an <code>integer-array</code> as follows:</p>
  <pre><code>   val country= resources.getStringArray(R.array.country_array)
     val flags = resources.getIntArray(R.array.country_flag_array)
  </code></pre>
  <p>which are in my <code>strings.xml</code> as follows:</p>
  <pre><code>&lt;string-array name=&quot;country_array&quot;&gt;
      &lt;item&gt;USA&lt;/item&gt;
      &lt;item&gt;France&lt;/item&gt;
      &lt;item&gt;Canada&lt;/item&gt;
  
  &lt;/string-array&gt;
  
  &lt;integer-array name=&quot;country_flag_array&quot;&gt;
      &lt;item&gt;@drawable/flag_united_states_of_america&lt;/item&gt;
      &lt;item&gt;@drawable/flag_france&lt;/item&gt;
      &lt;item&gt;@drawable/flag_canada&lt;/item&gt;
  
  &lt;/integer-array&gt;
  </code></pre>
  <p>I have a <code>data class</code> as follows to add the country flag and it's name to populate a <code>recyclerView</code>.</p>
  <pre><code>data class CountryObject(val flagImage : Int, val country: String)
  </code></pre>
  <p>I have this function to populate a <code>list</code> with the flags and country:</p>
  <pre><code>private fun addCountriesToList(country: Array&lt;String&gt;, flgs : IntArray) : List&lt;CountryObject&gt;{
  
          val listCountry= ArrayList&lt;CountryObject&gt;()
  
          for(c in country){
              for (f in flgs){
                  listCountry.add(CountryObject(f,  c))
              }
          }
  
          return listCountry
      }
  </code></pre>
  <p>EDIT : ADDITIONAL CODE:</p>
  <p>This is where I am saving the <code>addCountriesToList</code> function</p>
  <pre><code>   val listCountry : List&lt;CountryObject&gt; = addCountriesToList(country, flags)
  </code></pre>
  <p>I have another function which populates the recycler view (Which I know works)</p>
  <pre><code>setupLanguageList(rv_country, listCountry , 0)
  </code></pre>
  <p>I can populate the <code>recyclerView</code> with the country names, but each country name is populated with the size of the array and the image does not show. So since there are 3 countries, each country is populated 3 times.</p>
  <p>Any help or advice will be highly appreciated as to why the languages are showing like that but not the images.</p>