• + 1 comment

    This algorithm doesnt work for all examples, for suppose if the inputs are n=9,m=3 and m inputs are (3,6,3), (5,7,10),(7,9,11). At 6th index we get the maximum 23 as output, but as per by the above algorithm we get the maximum value is 13.