Suggest add explanation for test case


  • 1
    K

    For example following test case:

    Input:
    [0,1,0,1,0,1,0,1,0,1]
    [-1,-2,-3,-4,-5]
    Expected:
    [-1.00000,-1.50000,-2.00000,-2.50000,-3.00000]
    

    First I thought it's all input stream, but after input [0,1,0,1,0,1,0,1,0,1], mid value should be 0.5
    then after input [-1], mid value should be 0
    after input [-2], mid value should be 0.5 again.

    Finally I found that the first array should mean which method to call, 0 means call addNum(), 1 means call findMedian().

    Takes me a while to figure out.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.