#include <iostream>
using namespace std;

int solution(int n)
{
    int ans = 0;
	int tmp = 0;
    while(true){
        if(n == 1){
            ans++;
            break;
        }
        
        if(n%2 == 0){
            n = n/2;
        }
        else{
            ans++;
            n = n/2 ;
        }

    }
    return ans;
}

+ Recent posts