Skip to content

Hacker rank

Avinash Thakur edited this page Aug 5, 2019 · 1 revision

TextWriter textWriter = new StreamWriter(@System.Environment.GetEnvironmentVariable("OUTPUT_PATH"), true);

    string[] firstMultipleInput = Console.ReadLine().TrimEnd().Split(' ');

    int n = Convert.ToInt32(firstMultipleInput[0]);

    int m = Convert.ToInt32(firstMultipleInput[1]);

    List<int> arr = Console.ReadLine().TrimEnd().Split(' ').ToList().Select(arrTemp => Convert.ToInt32(arrTemp)).ToList();

    List<int> brr = Console.ReadLine().TrimEnd().Split(' ').ToList().Select(brrTemp => Convert.ToInt32(brrTemp)).ToList();

    int total = Result.getTotalX(arr, brr);

    textWriter.WriteLine(total);

    textWriter.Flush();
    textWriter.Close();

Clone this wiki locally