title: Print the number of characters which are identical and occur in the same position in both strings
body: <p>For example if &quot;abacdead&quot; and &quot;adcbadedga&quot; are the two strings then we need to print the same position and different position.</p>
  <pre><code>    same pos count: 2
      diff pos count: 5
  </code></pre>
  <p>If we are using loop means, a (first letter) will be checking all the characters (string 2), So the loop will be run by more than 140 times, Here How can we achieve the O (n). If we have any data structure, Please suggest me to solve this issue.</p>
  <p><strong>Sample code</strong></p>
  <pre><code>   func Test(a, b string) {
      r := make([]map[string]interface{}, 0)
      for i := 0; i &lt; len(a); i++ {
          for j := 0; j &lt; len(b); j++ {
              if string(a[i]) == string(b[j]) {
                  r = append(r, map[string]interface{}{
                      &quot;position&quot;: i,
                      &quot;char&quot;:     string(a[i]),
                  })
              }
  
              
          }
      }
  }
  </code></pre>