JavaScript one line solution


  • 0
    W

    i don't think it's simplest solution. please making it more simple.

    function (nums){
        return nums.toString().replace(/,/g, '').split('0').reduce(function(x,y){return x>y?x:y;}).length;
    }
    

Log in to reply
 

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