Beta

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

Puzzles

Stats:

CreatedNov 14, 2017
PublishedNov 14, 2017
Warriors Trained47
Total Skips0
Total Code Submissions87
Total Times Completed9
JavaScript Completions9
Total Stars2
% of votes with a positive feedback rating38% of 4
Total "Very Satisfied" Votes1
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes2
Total Rank Assessments2
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • ccnklc Avatar
Ad