title: Count Set Bits In An Integer
signature: pub fn count_set_bits_in_an_integer(n: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        58, 
        4
      ));
      
      println!("TEST-1...{}", driver(
        92, 
        4
      ));
      
      println!("TEST-2...{}", driver(
        73, 
        3
      ));
      
      println!("TEST-3...{}", driver(
        52, 
        3
      ));
      
      println!("TEST-4...{}", driver(
        24, 
        2
      ));
      
      println!("TEST-5...{}", driver(
        14, 
        3
      ));
      
      println!("TEST-6...{}", driver(
        58, 
        4
      ));
      
      println!("TEST-7...{}", driver(
        11, 
        3
      ));
      
      println!("TEST-8...{}", driver(
        8, 
        1
      ));
      
      println!("TEST-9...{}", driver(
        52, 
        3
      ));
      
  }
source_py: def count_set_bits_in_an_integer(n):
      count = 0
      while n:
          count += (n & 1)
          n >>= 1
      return count
source_cpp: unsigned int count_set_bits_in_an_integer(unsigned int n) {
    unsigned int count = 0;
    while ( n ) {
      count += n & 1;
      n >>= 1;
    }
    return count;
  }