Cryptography Challenge - Log of Lights
Description:
There are two rooms,
In the first one there is machine that turns the light off and on randomly and In the second one a person turn the light off and on as he/she wishes.
We get the log files of the light condition in every second in an array
example: log = [1,0,0,1,1,1,0] 1 represents on and 0 represents off.
The problem is someone messed up the log files and lost track of which log is belongs to which room but manage to keep them in pairs.
Your duty is to write a function that takes two arrays (logs1 and logs2) and find which log belongs to which room.
Function should return an array [1,2] or [2,1] depends on which logs belongs to which room.
The only thing you can be sure that one of the logs given is belongs to a person and others to machine.
1 if the log is belongs to machine 2 if the log is belongs to person
Similar Kata:
Stats:
Created | Nov 14, 2017 |
Published | Nov 14, 2017 |
Warriors Trained | 47 |
Total Skips | 0 |
Total Code Submissions | 87 |
Total Times Completed | 9 |
JavaScript Completions | 9 |
Total Stars | 2 |
% of votes with a positive feedback rating | 38% of 4 |
Total "Very Satisfied" Votes | 1 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 2 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 6 kyu |