Find all the index of matching elements in the multiple Array












-1














Suppose I have two arrays as follows



int first = { 1, 2, 3, 4, 5, 6, 12, 13, 14 };
int second = { 12, 13, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 };


I want the result as follows:



matching index from the first = 6,7,8 
matching index from second = 0,1,2


Condition: I cannot sort the array to find the index and there can be any number of the array.



I am looking for some efficient solution and I will be glad for the help.
Thanks in advance.



Below is the code I did for the two arrays:



class Program
{
static void Main(string args)
{
int first = { 1, 2, 3, 4, 5, 6, 12, 13, 14 };
int second = { 12, 13, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 };
IndexArray sameIndexArray = CompareArray(first, second);
Console.WriteLine("FOLLOWING ARE THE INDEX WITH SAME VALUE FOR FIRST ARRAY");
foreach (var index in sameIndexArray.FirstArray)
{
Console.WriteLine(index);
}
Console.WriteLine("FOLLOWING ARE THE INDEX WITH SAME VALUE FOR SECOND ARRAY");
foreach (var index in sameIndexArray.SecondArray)
{
Console.WriteLine(index);
}

Console.ReadKey();
}

private static IndexArray CompareArray(int firstArray, int secondArray)
{
IndexArray arrayIndex = new IndexArray();
arrayIndex.FirstArray = new List<int>();
arrayIndex.SecondArray = new List<int>();
for (int i = 0; i < firstArray.Length; i++)
{
for (int j = 0; j < secondArray.Length; j++)
{
if (firstArray[i] == secondArray[j])
{
arrayIndex.FirstArray.Add(i);
arrayIndex.SecondArray.Add(j);
}
}
}

return arrayIndex;
}
}

public class IndexArray
{
public List<int> FirstArray { get; set; }
public List<int> SecondArray { get; set; }
}









share|improve this question





























    -1














    Suppose I have two arrays as follows



    int first = { 1, 2, 3, 4, 5, 6, 12, 13, 14 };
    int second = { 12, 13, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 };


    I want the result as follows:



    matching index from the first = 6,7,8 
    matching index from second = 0,1,2


    Condition: I cannot sort the array to find the index and there can be any number of the array.



    I am looking for some efficient solution and I will be glad for the help.
    Thanks in advance.



    Below is the code I did for the two arrays:



    class Program
    {
    static void Main(string args)
    {
    int first = { 1, 2, 3, 4, 5, 6, 12, 13, 14 };
    int second = { 12, 13, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 };
    IndexArray sameIndexArray = CompareArray(first, second);
    Console.WriteLine("FOLLOWING ARE THE INDEX WITH SAME VALUE FOR FIRST ARRAY");
    foreach (var index in sameIndexArray.FirstArray)
    {
    Console.WriteLine(index);
    }
    Console.WriteLine("FOLLOWING ARE THE INDEX WITH SAME VALUE FOR SECOND ARRAY");
    foreach (var index in sameIndexArray.SecondArray)
    {
    Console.WriteLine(index);
    }

    Console.ReadKey();
    }

    private static IndexArray CompareArray(int firstArray, int secondArray)
    {
    IndexArray arrayIndex = new IndexArray();
    arrayIndex.FirstArray = new List<int>();
    arrayIndex.SecondArray = new List<int>();
    for (int i = 0; i < firstArray.Length; i++)
    {
    for (int j = 0; j < secondArray.Length; j++)
    {
    if (firstArray[i] == secondArray[j])
    {
    arrayIndex.FirstArray.Add(i);
    arrayIndex.SecondArray.Add(j);
    }
    }
    }

    return arrayIndex;
    }
    }

    public class IndexArray
    {
    public List<int> FirstArray { get; set; }
    public List<int> SecondArray { get; set; }
    }









    share|improve this question



























      -1












      -1








      -1


      2





      Suppose I have two arrays as follows



      int first = { 1, 2, 3, 4, 5, 6, 12, 13, 14 };
      int second = { 12, 13, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 };


      I want the result as follows:



      matching index from the first = 6,7,8 
      matching index from second = 0,1,2


      Condition: I cannot sort the array to find the index and there can be any number of the array.



      I am looking for some efficient solution and I will be glad for the help.
      Thanks in advance.



      Below is the code I did for the two arrays:



      class Program
      {
      static void Main(string args)
      {
      int first = { 1, 2, 3, 4, 5, 6, 12, 13, 14 };
      int second = { 12, 13, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 };
      IndexArray sameIndexArray = CompareArray(first, second);
      Console.WriteLine("FOLLOWING ARE THE INDEX WITH SAME VALUE FOR FIRST ARRAY");
      foreach (var index in sameIndexArray.FirstArray)
      {
      Console.WriteLine(index);
      }
      Console.WriteLine("FOLLOWING ARE THE INDEX WITH SAME VALUE FOR SECOND ARRAY");
      foreach (var index in sameIndexArray.SecondArray)
      {
      Console.WriteLine(index);
      }

      Console.ReadKey();
      }

      private static IndexArray CompareArray(int firstArray, int secondArray)
      {
      IndexArray arrayIndex = new IndexArray();
      arrayIndex.FirstArray = new List<int>();
      arrayIndex.SecondArray = new List<int>();
      for (int i = 0; i < firstArray.Length; i++)
      {
      for (int j = 0; j < secondArray.Length; j++)
      {
      if (firstArray[i] == secondArray[j])
      {
      arrayIndex.FirstArray.Add(i);
      arrayIndex.SecondArray.Add(j);
      }
      }
      }

      return arrayIndex;
      }
      }

      public class IndexArray
      {
      public List<int> FirstArray { get; set; }
      public List<int> SecondArray { get; set; }
      }









      share|improve this question















      Suppose I have two arrays as follows



      int first = { 1, 2, 3, 4, 5, 6, 12, 13, 14 };
      int second = { 12, 13, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 };


      I want the result as follows:



      matching index from the first = 6,7,8 
      matching index from second = 0,1,2


      Condition: I cannot sort the array to find the index and there can be any number of the array.



      I am looking for some efficient solution and I will be glad for the help.
      Thanks in advance.



      Below is the code I did for the two arrays:



      class Program
      {
      static void Main(string args)
      {
      int first = { 1, 2, 3, 4, 5, 6, 12, 13, 14 };
      int second = { 12, 13, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 };
      IndexArray sameIndexArray = CompareArray(first, second);
      Console.WriteLine("FOLLOWING ARE THE INDEX WITH SAME VALUE FOR FIRST ARRAY");
      foreach (var index in sameIndexArray.FirstArray)
      {
      Console.WriteLine(index);
      }
      Console.WriteLine("FOLLOWING ARE THE INDEX WITH SAME VALUE FOR SECOND ARRAY");
      foreach (var index in sameIndexArray.SecondArray)
      {
      Console.WriteLine(index);
      }

      Console.ReadKey();
      }

      private static IndexArray CompareArray(int firstArray, int secondArray)
      {
      IndexArray arrayIndex = new IndexArray();
      arrayIndex.FirstArray = new List<int>();
      arrayIndex.SecondArray = new List<int>();
      for (int i = 0; i < firstArray.Length; i++)
      {
      for (int j = 0; j < secondArray.Length; j++)
      {
      if (firstArray[i] == secondArray[j])
      {
      arrayIndex.FirstArray.Add(i);
      arrayIndex.SecondArray.Add(j);
      }
      }
      }

      return arrayIndex;
      }
      }

      public class IndexArray
      {
      public List<int> FirstArray { get; set; }
      public List<int> SecondArray { get; set; }
      }






      c# arrays






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 19:05









      stack0114106

      2,2561417




      2,2561417










      asked Nov 21 '18 at 18:52









      Sobit KarkiSobit Karki

      21




      21
























          2 Answers
          2






          active

          oldest

          votes


















          3














          Your solution is O(N^2). An O(N) or O(N log N) solution should be possible:




          • Create a HashSet for each of the sets

          • iterate over the first set, filtering by hashset2.Contains and print the indexes

          • do the same vice versa


          Something like this:



          private static IndexArray CompareArray(int firstArray, int secondArray)
          {
          IndexArray arrayIndex = new IndexArray();
          var hashset2 = new HashSet<int>(secondArray);
          for (int i = 0; i < firstArray.Length; i++)
          {
          if (hashset2.Contains(firstArray[i]))
          arrayIndex.FirstArray.Add(i);
          }
          var hashset1 = new HashSet<int>(firstArray);
          for (int i = 0; i < secondArray.Length; i++)
          {
          if (hashset1.Contains(secondArray[i]))
          arrayIndex.SecondArray.Add(i);
          }

          return arrayIndex;
          }





          share|improve this answer























          • O(n) is not always faster than O(n*m). This is multiple O(n) operations
            – paparazzo
            Nov 21 '18 at 19:39






          • 2




            @paparazzo Sure, O(...) is a limit and for not too large N a factor might matter. But O(4*N) = O(N).
            – Klaus Gütter
            Nov 21 '18 at 19:41










          • Still does not mean it is faster. Cheers. I know what O( ) means.
            – paparazzo
            Nov 21 '18 at 19:45










          • @paparazzo N = 10.000: original: 560 ms / mine: 1 ms; N = 100.000: original: 50000 ms / mine: 14 ms
            – Klaus Gütter
            Nov 21 '18 at 19:53












          • No doubt you can contrive a case where your answer is faster. If I contrive a case where the values are unique with a lot of overlap it would be faster. Moving on.
            – paparazzo
            Nov 21 '18 at 20:01



















          0














          If this is working code it might be a better fit on code review.



          I would drop the



          arrayIndex.FirstArray = new List<int>();
          arrayIndex.SecondArray = new List<int>();


          Add



          public List<int> FirstArray  { get; } = new List<int>();
          public List<int> SecondArray { get; } = new List<int>();


          Arraylookup is fast but I would add



          int first = firstArray[i];


          And then use that.



          WritelLine will write a line.






          share|improve this answer























          • this example is just for the two array but I am asking for the efficient solution for any number of array. function should return me all the matching indexes on any number of array. Thanks.
            – Sobit Karki
            Nov 21 '18 at 21:54











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418796%2ffind-all-the-index-of-matching-elements-in-the-multiple-array%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          Your solution is O(N^2). An O(N) or O(N log N) solution should be possible:




          • Create a HashSet for each of the sets

          • iterate over the first set, filtering by hashset2.Contains and print the indexes

          • do the same vice versa


          Something like this:



          private static IndexArray CompareArray(int firstArray, int secondArray)
          {
          IndexArray arrayIndex = new IndexArray();
          var hashset2 = new HashSet<int>(secondArray);
          for (int i = 0; i < firstArray.Length; i++)
          {
          if (hashset2.Contains(firstArray[i]))
          arrayIndex.FirstArray.Add(i);
          }
          var hashset1 = new HashSet<int>(firstArray);
          for (int i = 0; i < secondArray.Length; i++)
          {
          if (hashset1.Contains(secondArray[i]))
          arrayIndex.SecondArray.Add(i);
          }

          return arrayIndex;
          }





          share|improve this answer























          • O(n) is not always faster than O(n*m). This is multiple O(n) operations
            – paparazzo
            Nov 21 '18 at 19:39






          • 2




            @paparazzo Sure, O(...) is a limit and for not too large N a factor might matter. But O(4*N) = O(N).
            – Klaus Gütter
            Nov 21 '18 at 19:41










          • Still does not mean it is faster. Cheers. I know what O( ) means.
            – paparazzo
            Nov 21 '18 at 19:45










          • @paparazzo N = 10.000: original: 560 ms / mine: 1 ms; N = 100.000: original: 50000 ms / mine: 14 ms
            – Klaus Gütter
            Nov 21 '18 at 19:53












          • No doubt you can contrive a case where your answer is faster. If I contrive a case where the values are unique with a lot of overlap it would be faster. Moving on.
            – paparazzo
            Nov 21 '18 at 20:01
















          3














          Your solution is O(N^2). An O(N) or O(N log N) solution should be possible:




          • Create a HashSet for each of the sets

          • iterate over the first set, filtering by hashset2.Contains and print the indexes

          • do the same vice versa


          Something like this:



          private static IndexArray CompareArray(int firstArray, int secondArray)
          {
          IndexArray arrayIndex = new IndexArray();
          var hashset2 = new HashSet<int>(secondArray);
          for (int i = 0; i < firstArray.Length; i++)
          {
          if (hashset2.Contains(firstArray[i]))
          arrayIndex.FirstArray.Add(i);
          }
          var hashset1 = new HashSet<int>(firstArray);
          for (int i = 0; i < secondArray.Length; i++)
          {
          if (hashset1.Contains(secondArray[i]))
          arrayIndex.SecondArray.Add(i);
          }

          return arrayIndex;
          }





          share|improve this answer























          • O(n) is not always faster than O(n*m). This is multiple O(n) operations
            – paparazzo
            Nov 21 '18 at 19:39






          • 2




            @paparazzo Sure, O(...) is a limit and for not too large N a factor might matter. But O(4*N) = O(N).
            – Klaus Gütter
            Nov 21 '18 at 19:41










          • Still does not mean it is faster. Cheers. I know what O( ) means.
            – paparazzo
            Nov 21 '18 at 19:45










          • @paparazzo N = 10.000: original: 560 ms / mine: 1 ms; N = 100.000: original: 50000 ms / mine: 14 ms
            – Klaus Gütter
            Nov 21 '18 at 19:53












          • No doubt you can contrive a case where your answer is faster. If I contrive a case where the values are unique with a lot of overlap it would be faster. Moving on.
            – paparazzo
            Nov 21 '18 at 20:01














          3












          3








          3






          Your solution is O(N^2). An O(N) or O(N log N) solution should be possible:




          • Create a HashSet for each of the sets

          • iterate over the first set, filtering by hashset2.Contains and print the indexes

          • do the same vice versa


          Something like this:



          private static IndexArray CompareArray(int firstArray, int secondArray)
          {
          IndexArray arrayIndex = new IndexArray();
          var hashset2 = new HashSet<int>(secondArray);
          for (int i = 0; i < firstArray.Length; i++)
          {
          if (hashset2.Contains(firstArray[i]))
          arrayIndex.FirstArray.Add(i);
          }
          var hashset1 = new HashSet<int>(firstArray);
          for (int i = 0; i < secondArray.Length; i++)
          {
          if (hashset1.Contains(secondArray[i]))
          arrayIndex.SecondArray.Add(i);
          }

          return arrayIndex;
          }





          share|improve this answer














          Your solution is O(N^2). An O(N) or O(N log N) solution should be possible:




          • Create a HashSet for each of the sets

          • iterate over the first set, filtering by hashset2.Contains and print the indexes

          • do the same vice versa


          Something like this:



          private static IndexArray CompareArray(int firstArray, int secondArray)
          {
          IndexArray arrayIndex = new IndexArray();
          var hashset2 = new HashSet<int>(secondArray);
          for (int i = 0; i < firstArray.Length; i++)
          {
          if (hashset2.Contains(firstArray[i]))
          arrayIndex.FirstArray.Add(i);
          }
          var hashset1 = new HashSet<int>(firstArray);
          for (int i = 0; i < secondArray.Length; i++)
          {
          if (hashset1.Contains(secondArray[i]))
          arrayIndex.SecondArray.Add(i);
          }

          return arrayIndex;
          }






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 21 '18 at 19:04

























          answered Nov 21 '18 at 18:57









          Klaus GütterKlaus Gütter

          2,1601019




          2,1601019












          • O(n) is not always faster than O(n*m). This is multiple O(n) operations
            – paparazzo
            Nov 21 '18 at 19:39






          • 2




            @paparazzo Sure, O(...) is a limit and for not too large N a factor might matter. But O(4*N) = O(N).
            – Klaus Gütter
            Nov 21 '18 at 19:41










          • Still does not mean it is faster. Cheers. I know what O( ) means.
            – paparazzo
            Nov 21 '18 at 19:45










          • @paparazzo N = 10.000: original: 560 ms / mine: 1 ms; N = 100.000: original: 50000 ms / mine: 14 ms
            – Klaus Gütter
            Nov 21 '18 at 19:53












          • No doubt you can contrive a case where your answer is faster. If I contrive a case where the values are unique with a lot of overlap it would be faster. Moving on.
            – paparazzo
            Nov 21 '18 at 20:01


















          • O(n) is not always faster than O(n*m). This is multiple O(n) operations
            – paparazzo
            Nov 21 '18 at 19:39






          • 2




            @paparazzo Sure, O(...) is a limit and for not too large N a factor might matter. But O(4*N) = O(N).
            – Klaus Gütter
            Nov 21 '18 at 19:41










          • Still does not mean it is faster. Cheers. I know what O( ) means.
            – paparazzo
            Nov 21 '18 at 19:45










          • @paparazzo N = 10.000: original: 560 ms / mine: 1 ms; N = 100.000: original: 50000 ms / mine: 14 ms
            – Klaus Gütter
            Nov 21 '18 at 19:53












          • No doubt you can contrive a case where your answer is faster. If I contrive a case where the values are unique with a lot of overlap it would be faster. Moving on.
            – paparazzo
            Nov 21 '18 at 20:01
















          O(n) is not always faster than O(n*m). This is multiple O(n) operations
          – paparazzo
          Nov 21 '18 at 19:39




          O(n) is not always faster than O(n*m). This is multiple O(n) operations
          – paparazzo
          Nov 21 '18 at 19:39




          2




          2




          @paparazzo Sure, O(...) is a limit and for not too large N a factor might matter. But O(4*N) = O(N).
          – Klaus Gütter
          Nov 21 '18 at 19:41




          @paparazzo Sure, O(...) is a limit and for not too large N a factor might matter. But O(4*N) = O(N).
          – Klaus Gütter
          Nov 21 '18 at 19:41












          Still does not mean it is faster. Cheers. I know what O( ) means.
          – paparazzo
          Nov 21 '18 at 19:45




          Still does not mean it is faster. Cheers. I know what O( ) means.
          – paparazzo
          Nov 21 '18 at 19:45












          @paparazzo N = 10.000: original: 560 ms / mine: 1 ms; N = 100.000: original: 50000 ms / mine: 14 ms
          – Klaus Gütter
          Nov 21 '18 at 19:53






          @paparazzo N = 10.000: original: 560 ms / mine: 1 ms; N = 100.000: original: 50000 ms / mine: 14 ms
          – Klaus Gütter
          Nov 21 '18 at 19:53














          No doubt you can contrive a case where your answer is faster. If I contrive a case where the values are unique with a lot of overlap it would be faster. Moving on.
          – paparazzo
          Nov 21 '18 at 20:01




          No doubt you can contrive a case where your answer is faster. If I contrive a case where the values are unique with a lot of overlap it would be faster. Moving on.
          – paparazzo
          Nov 21 '18 at 20:01













          0














          If this is working code it might be a better fit on code review.



          I would drop the



          arrayIndex.FirstArray = new List<int>();
          arrayIndex.SecondArray = new List<int>();


          Add



          public List<int> FirstArray  { get; } = new List<int>();
          public List<int> SecondArray { get; } = new List<int>();


          Arraylookup is fast but I would add



          int first = firstArray[i];


          And then use that.



          WritelLine will write a line.






          share|improve this answer























          • this example is just for the two array but I am asking for the efficient solution for any number of array. function should return me all the matching indexes on any number of array. Thanks.
            – Sobit Karki
            Nov 21 '18 at 21:54
















          0














          If this is working code it might be a better fit on code review.



          I would drop the



          arrayIndex.FirstArray = new List<int>();
          arrayIndex.SecondArray = new List<int>();


          Add



          public List<int> FirstArray  { get; } = new List<int>();
          public List<int> SecondArray { get; } = new List<int>();


          Arraylookup is fast but I would add



          int first = firstArray[i];


          And then use that.



          WritelLine will write a line.






          share|improve this answer























          • this example is just for the two array but I am asking for the efficient solution for any number of array. function should return me all the matching indexes on any number of array. Thanks.
            – Sobit Karki
            Nov 21 '18 at 21:54














          0












          0








          0






          If this is working code it might be a better fit on code review.



          I would drop the



          arrayIndex.FirstArray = new List<int>();
          arrayIndex.SecondArray = new List<int>();


          Add



          public List<int> FirstArray  { get; } = new List<int>();
          public List<int> SecondArray { get; } = new List<int>();


          Arraylookup is fast but I would add



          int first = firstArray[i];


          And then use that.



          WritelLine will write a line.






          share|improve this answer














          If this is working code it might be a better fit on code review.



          I would drop the



          arrayIndex.FirstArray = new List<int>();
          arrayIndex.SecondArray = new List<int>();


          Add



          public List<int> FirstArray  { get; } = new List<int>();
          public List<int> SecondArray { get; } = new List<int>();


          Arraylookup is fast but I would add



          int first = firstArray[i];


          And then use that.



          WritelLine will write a line.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 21 '18 at 19:48

























          answered Nov 21 '18 at 19:25









          paparazzopaparazzo

          37.5k1673137




          37.5k1673137












          • this example is just for the two array but I am asking for the efficient solution for any number of array. function should return me all the matching indexes on any number of array. Thanks.
            – Sobit Karki
            Nov 21 '18 at 21:54


















          • this example is just for the two array but I am asking for the efficient solution for any number of array. function should return me all the matching indexes on any number of array. Thanks.
            – Sobit Karki
            Nov 21 '18 at 21:54
















          this example is just for the two array but I am asking for the efficient solution for any number of array. function should return me all the matching indexes on any number of array. Thanks.
          – Sobit Karki
          Nov 21 '18 at 21:54




          this example is just for the two array but I am asking for the efficient solution for any number of array. function should return me all the matching indexes on any number of array. Thanks.
          – Sobit Karki
          Nov 21 '18 at 21:54


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418796%2ffind-all-the-index-of-matching-elements-in-the-multiple-array%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          TypeError: fit_transform() missing 1 required positional argument: 'X'