LeetSolve
Published in

LeetSolve

C++ Solution to Coding Challenge 1680. Concatenation of Consecutive Binary Numbers

Bit manipulation, mathematics and recursion

Problem statement

Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 10^9 + 7.

--

--

LeetSolve shares how to solve a coding question in C++. The questions are selected from leetcode.com. You can learn from LeetSolve’s posts essential algorithms, basic data structures, elementary C++ programming language and common coding techniques.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store