title: Count Set Bits In An Integer 3
signature: def count_set_bits_in_an_integer_3(n):
source_py: def count_set_bits_in_an_integer_3(n):
      if (n == 0):
          return 0
      else:
          return (1 + count_set_bits_in_an_integer_3((n & (n - 1))))
source_cpp: int count_set_bits_in_an_integer_3(int n) {
    if ( n == 0 ) return 0;
    else return 1 + count_set_bits_in_an_integer_3 ( n & ( n - 1 ) );
  }
question_info.test_code: import array
  import bisect
  import collections
  import datetime
  import functools
  import heapq
  import itertools
  import math
  import queue
  import re
  import string
  import sys
  from typing import Any, Dict, List, Optional, Set
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  def validate_solution(actual, expected):
      return actual == expected
  
  def driver(n, expected):
      try:
          if validate_solution(PLACEHOLDER_FN_NAME(
              n),
              expected
          ):
              return "PASSED"
          return "FAILED"
      except Exception as exception_obj:
          return type(exception_obj).__name__
      
  if __name__ == "__main__":
      result = driver(6, 2)
      print(f"TEST-0...{result}")
  
      result = driver(58, 4)
      print(f"TEST-1...{result}")
  
      result = driver(90, 4)
      print(f"TEST-2...{result}")
  
      result = driver(69, 3)
      print(f"TEST-3...{result}")
  
      result = driver(15, 4)
      print(f"TEST-4...{result}")
  
      result = driver(54, 4)
      print(f"TEST-5...{result}")
  
      result = driver(60, 4)
      print(f"TEST-6...{result}")
  
      result = driver(51, 4)
      print(f"TEST-7...{result}")
  
      result = driver(46, 4)
      print(f"TEST-8...{result}")
  
      result = driver(91, 5)
      print(f"TEST-9...{result}")
  
      sys.exit(0)
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.entry_fn_name: count_set_bits_in_an_integer_3
question_info.test_list: [{"idx": 0, "outputs": 2, "inputs": {"n": 6}}, {"idx": 1, "outputs": 4, "inputs": {"n": 58}}, {"idx": 2, "outputs": 4, "inputs": {"n": 90}}, {"idx": 3, "outputs": 3, "inputs": {"n": 69}}, {"idx": 4, "outputs": 4, "inputs": {"n": 15}}, {"idx": 5, "outputs": 4, "inputs": {"n": 54}}, {"idx": 6, "outputs": 4, "inputs": {"n": 60}}, {"idx": 7, "outputs": 4, "inputs": {"n": 51}}, {"idx": 8, "outputs": 4, "inputs": {"n": 46}}, {"idx": 9, "outputs": 5, "inputs": {"n": 91}}]
question_info.entry_cls_name: Solution