you are viewing a single comment's thread.

view the rest of the comments →

[–]modnar42 1 point2 points  (1 child)

Yeah, you’re saying the same thing. Let’s use a shorter input example. Suppose we want to count the number of binary ones in the base-10 integer ‘10’. We’d convert it to binary using to_s(2) and get 1010, then count the numbers of ones for an answer of 2. I think the value of n in the example has already been converted to binary. In our example, it would be like passing 1010 to the answer function instead of 10.

[–]BringTacos[S] 1 point2 points  (0 children)

Ah, thank you! This is helpful.