Max-Min Difference in an Interval

Sort by

recency

|

17 Discussions

|

  • + 1 comment

    Table of explaination is wrong.

    min list must be : [1, 1, 1, 1, 2, 1, 2, 1, 1, 4]

    max list must be : [1, 2, 1, 4, 2, 2, 4, 1, 4, 4]

  • + 0 comments
    a[n++] = MAXA * 2 + 1;
    

    why was (n + 1)th value added to the array in the editorial ?

  • + 0 comments

    WOW...the problem statments are just confusing.

  • + 0 comments

    It can be solvable with two pointer and RMQ(Sparse table) in N*Q complexity.

  • + 0 comments

    The code for Javascript and Ruby also has the same mistakes.

    var [low, high] = readLine().trim().split(' ');
    low = parseInt(low);
    high = parseInt(high);
    
    low, high = gets.strip.split(' ')
    low = low.to_i
    high = high.to_i