find the divisor of x in the given range


  • 0
    C

    given l and r , 1<= l <= x<= r<= 10^9 , for each x, write down all its divisors , for each divisor, only record its highest number. you should output the times each number occur.
    for example
    1 4
    4
    2
    1
    1
    0
    0
    0
    0
    0

    i have used a O(n) method but still TLE


Log in to reply
 

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