There are 2 lists as List<int> a which has 3 scores such as {5,6,10} and the other list as List<int> b = {3,6,30}. Comparison should be done to check as follows,
0th index of list a > 0th index of list b = return 1 for a
or 0th index of list a = 0th index of list b = retunr 0 value since it is equal
or 0th index of list a < 0th index of list b = return 1 for b
the comparison should be done to each and every index as (a0,b0),(a1,b1) and (a2,b2).
and should return the total of 1s to a separate array.
sample output for the above example: {1,1}(here 0th index is for the total of list a and 1st index is for the total of list b.
What I have tried:
<pre>class Solution {
static List<int> compareTriplets(List<int> a, List<int> b) {
}
static void Main(string[] args) {
TextWriter textWriter = new StreamWriter(@System.Environment.GetEnvironmentVariable("OUTPUT_PATH"), true);
List<int> a = Console.ReadLine().TrimEnd().Split(' ').ToList().Select(aTemp => Convert.ToInt32(aTemp)).ToList();
List<int> b = Console.ReadLine().TrimEnd().Split(' ').ToList().Select(bTemp => Convert.ToInt32(bTemp)).ToList();
List<int> result = compareTriplets(a, b);
textWriter.WriteLine(String.Join(" ", result));
textWriter.Flush();
textWriter.Close();
}
}