C ++ program to find the Maximum distance between two 1 's in Binary representation of N
#include <bits/stdc++.h> NEW_LINE using namespace std ; int longest_gap ( int N ) { int distance = 0 , count = 0 , first_1 = -1 , last_1 = -1 ;