题解 | 求int型正整数在内存中存储时1的个数
const rl = require("readline").createInterface({ input: process.stdin }); var iter = rl[Symbol.asyncIterator](); const readline = async () => (await iter.next()).value; void async function () { // Write your code here const num = await readline() const binary = Number(num).toString(2) const binArr = [...binary] const length = binArr.filter((item) => item == "1").length console.log(length) }()