Google India phone screen | L4 | reject | oct 2024

Anonymous User
1660
Oct 25, 2024

How to solve it efficiently
Create a bit string composed of 0s and 1s that has exactly n distinct subsequences.

A subsequence is formed by deleting some characters from the string without changing the order of the remaining characters. For example, in the bit string "101", the distinct subsequences include 0, 1, 01, 10, 11, and 101.

Find the minimum length bit string that satisfies this condition.

Input: n = 6
Output: "101"

multiple answers possible.

Comments (6)