Skip to content

Analyzing user input #3

@bltomlin

Description

@bltomlin
  1. Read the user input the same way as in the previous stage;
    
  2. Get all possible triads from the string. For each of them, count the number of 0 and 1 that follow them;
    
  3. Output the result in the following format: triad: {counts_of_0}, {counts_of_1}, for example, 000: 57,12. Print the result for each triad on a new line. The triads must be ordered in ascending order of their decimal representation — for example, 110 in binary equals 1⋅4+1⋅2+0⋅1=61\cdot4+1\cdot2+0\cdot1 = 61⋅4+1⋅2+0⋅1=6 in decimal.
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions