👩💻 Join our community of thousands of amazing developers!

2595. Number of Even and Odd Bits You are given a positive integer n. Let even denote the number of even indices in the binary representation of n (0-indexed) with value 1. Let odd denote the number of odd indices in the binary representation of n (0-indexed) with value 1. Return an integer array answer where answer = [even, odd]. ...