Skip to content

Instantly share code, notes, and snippets.

@arlolra
Created April 11, 2011 01:58
Show Gist options
  • Save arlolra/912965 to your computer and use it in GitHub Desktop.
Save arlolra/912965 to your computer and use it in GitHub Desktop.
// opzi problem 2
// http://opzi.posterous.com/challenge-2
var count = 0,
SET_A = ['01001100','01101000','01010000','01010011','01001001','01000011','01101000','01101001','01110110','01101001','01110000','01101100','01100010','01000111','01101000','01111010','01100101','01111001','01101101','01100001'],
SET_B = ['10010001','01011110','01100101','10011010','10000010','11110000','11010000','00101101','11111000','11010110','11100000','00011011','01101110','11110000','01101100','01101010','11001010','11001011','01101110','01110010'];
SET_A.forEach(function (s) {
var str = s.split(''),
ls = str.length;
for (var x = 0, y; x < ls; x++) {
y = str.pop();
str.unshift(y);
if (str.join('') === SET_B[count]) {
console.log(s);
}
}
count += 1;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment