Why My code is Memory Limit Exceeded


  • 0
    J

    My code is written by js.

    var countBits = function(num) {
        var numbers = [];
        for (var i = 0; i <= num; ++i) {
            numbers.push((numbers[i>>1] || 0) + i % 2);
        }
        return numbers;
    };
    

    I don't know which code course Memory Limit Exceeded


Log in to reply
 

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