Skip to content
Advertisement

Given a list of binary numbers (0s and 1s), determine the number of possible arrangements of distinct binary sequences using given 0s and 1s

Given a list of binary numbers (0s and 1s), determine the number of possible arrangements of distinct binary sequences using given 0s and 1s.

Input Format:

A single line of input containing 0s and 1s

Output Format:

Print an integer value indicating the number of possible arrangements using given 0s and 1s

Example:

Input:

0 1 0 1

Output:

6

Explanation:

For the given input, the possible distinct binary sequences that can be formed are 0011, 0101, 0110, 1001, 1010, 1100.

Hence the output is 6. I have tried this but getting error.

JavaScript

Click here to see my output

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement