Hash Tables: Ice Cream Parlor

  • + 2 comments

    I was facing an issue with the C# given code for this problem and finally solved it. There's some issue with this code:

    string[] arr_temp = Console.ReadLine().Split(' ');
    int[] arr = Array.ConvertAll(arr_temp,Int32.Parse);
    

    I'm not sure what it is. Maybe the platform this runs on is misinterpreting the size of arr_temp and it's not doing the converstion properly. I had to instead individually parse using Int32.Parse for each element in arr_temp and put it into a new array arr.

    I also used the hashmap way to solve this. It's a lot faster than the binary search option and passed all cases.