7 kyu

Highest power of 2 that evenly divides a number

299 of 622d0n14

Description:

Write a function that takes a number and returns highest power of 2 that evenly divides the number.

Examples:

for n =    123, should return  1
for n =    192, should return 64
for n = 132232, should return  8

Assume that: number is an integer within the range [1..10^18].

Fundamentals

More By Author:

Check out these other kata created by d0n14

Stats:

CreatedMar 28, 2017
PublishedMar 28, 2017
Warriors Trained1061
Total Skips30
Total Code Submissions1814
Total Times Completed622
C++ Completions299
C# Completions118
PHP Completions96
C Completions63
COBOL Completions8
Total Stars14
% of votes with a positive feedback rating92% of 172
Total "Very Satisfied" Votes151
Total "Somewhat Satisfied" Votes15
Total "Not Satisfied" Votes6
Total Rank Assessments17
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • d0n14 Avatar
  • smile67 Avatar
  • donaldsebleung Avatar
  • aweleshetu Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • hobovsky Avatar
  • akar-0 Avatar
Ad