Counting Bits Solutions in GoNumber 338Difficulty MediumAcceptance 69.6%Link LeetCodeOther languages C++SolutionsGo solution by halfrost/LeetCode-Gopackage leetcode func countBits(num int) []int { bits := make([]int, num+1) for i := 1; i <= num; i++ { bits[i] += bits[i&(i-1)] + 1 } return bits}package leetcode func countBits(num int) []int { bits := make([]int, num+1) for i := 1; i <= num; i++ { bits[i] += bits[i&(i-1)] + 1 } return bits }