• + 1 comment

    i have a question.

    i had to alter the main func generated by HR, cause the original func try to convert the input (given by HR) values of the list in 32bits value, but some outputs is bigger than 32b. so, i alter the method "Convert.ToInt32" for "Convert.ToInt64". after, the code pass.

    the question is: should i change the main function in some exercises?

    i dont know if the ex is not working correctly, if i cheated the ex or if I just did what was supposed to be done.

    can someone help me?

    obs: the parameter of my func is changed from "List int" (generated by HR) for "List long"

    using System.CodeDom.Compiler;
    using System.Collections.Generic;
    using System.Collections;
    using System.ComponentModel;
    using System.Diagnostics.CodeAnalysis;
    using System.Globalization;
    using System.IO;
    using System.Linq;
    using System.Reflection;
    using System.Runtime.Serialization;
    using System.Text.RegularExpressions;
    using System.Text;
    using System;
    
    class Result
    {
    
        /*
         * Complete the 'miniMaxSum' function below.
         *
         * The function accepts INTEGER_ARRAY arr as parameter.
         */
    
        public static void miniMaxSum(List<long> arr)
        {
            long min = arr.Min();
            long max = arr.Max();
            long sum = arr.Sum();
            Console.WriteLine($"{sum - max} {sum - min}");
        }
    
    }
    
    class Solution
    {
        public static void Main(string[] args)
        {
    
            List<long> arr = Console.ReadLine().TrimEnd().Split(' ').ToList().Select(arrTemp => Convert.ToInt64(arrTemp)).ToList();
    
            Result.miniMaxSum(arr);
        }
    }