title: How to sort two arraylist and then compare that they are same
body: <blockquote>
    <p>I am trying to sort the two array elements and match them with one another if one any one match it returns lucky otherwise unlucky, any ideas that where i am going to wrong</p>
  </blockquote>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  
  namespace Apptest
  {
  class Program
  {
      static void Main(string[] args)
      {
          int[] arr1 = { 5,4,3,8,1};
          int[] arr2 = { 8,1,5,4,3};
          string str = rollingdice(arr1, arr2);
          Console.WriteLine(str);
      }
      public static string rollingdice(int[] input1, int[] input2)
      {
         // input1.Sort();
          //input2.Sort();
          for(int i=0;i&lt;input1.Length &amp;&amp; i&lt;input2.Length;i++)
          {
              if (!Object.Equals(input1[i], input2[i]))
              {
                  return "unlucky";
              }
              else
              {
                  return "Lucky";
              }
          }
      }
  }
  }
  </code></pre>