❇ separate-black-and-white-balls Images👌 🏆O(N)❤️ Javascript🎯 Runtime👀43%🕕 ++Explanation✍️🔴🔥✅
Time Complexity: O(N)\uD83D\uDD55\nSpace Complexity: O(1)\n\n\nvar minimumSteps = function (array) {\n    let count = 0;\n    let combinedCount = 0;\n    for (l
**Time Complexity: O(N)\uD83D\uDD55\nSpace Complexity: O(1)**\n\n```\nvar minimumSteps = function (array) {\n    let count = 0;\n    let combinedCount = 0;\n    for (let index = 0; index < array.length; index++) {\n        if (array[index] === \'1\') {\n            combinedCount += 1;\n        } else {\n            count += combinedCount;\n        }\n    }\n    return count;\n};\n```\n\nPlease upvote \uD83D\uDCAA if like\n
['JavaScript']