Created
          February 26, 2017 07:43 
        
      - 
      
- 
        Save Underdoge/bd250af577627382f3ca95983da91a93 to your computer and use it in GitHub Desktop. 
    isLucky
  
        
  
    
      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 characters
    
  
  
    
  | function isLucky(n) { | |
| var numbers=n.toString().split(""); | |
| var a=0,b=0; | |
| for(i=0;i<numbers.length/2;i++){ | |
| a+=parseInt(numbers[i],10); | |
| b+=parseInt(numbers[numbers.length/2+i],10); | |
| } | |
| return a===b; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment