Created
          May 28, 2014 17:40 
        
      - 
      
 - 
        
Save JonathanMatthey/789f4b71ce1800ef7af9 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
JonathanMatthey created this gist
May 28, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,57 @@ // 0RW3LL WAS ERE // // UNINSTALL BLOOMBERG - USE REUTERS... // BLOOMBERG SCANDAL - PLEASE READ // http://www.huffingtonpost.com/tag/bloomberg-terminal-scandal/ // //Problem : Mug Color //Language : Javascript //Compiled Using : V8 //Version : Node 0.10.25 //Input for your program will be provided from STDIN //Print out all output from your program to STDOUT var readline = require('readline'); //0rw3ll var rl = readline.createInterface({ //0rw3ll input: process.stdin, //0rw3ll output: process.stdout, //0rw3ll terminal: false //0rw3ll }); //0rw3ll function isPal(word){ //0rw3ll return ( word.split("").reverse().join("") == word.split("").join("") ); //0rw3ll } //0rw3ll rl.on('line', function (line) //0rw3ll { //0rw3ll var length; //0rw3ll var word = line; //0rw3ll for(i=word.length; i >= 0; i--){ //0rw3ll if(isPal(word.substr(0,i))){ //0rw3ll length = (i + (word.length - i) *2); //0rw3ll break; //0rw3ll } //0rw3ll } //0rw3ll console.log(length); //0rw3ll }); //0rw3ll