알고리즘(CF)2017. 6. 8. 19:52

Ticket numbers usually consist of an even number of digits. A ticket number is considered lucky if the sum of the first half of the digits is equal to the sum of the second half.

Given a ticket number n, determine if it's lucky or not.




Example

  • For n = 1230, the output should be
    isLucky(n) = true;
  • For n = 239017, the output should be
    isLucky(n) = false.




Code


function isLucky(n) {


}

'알고리즘(CF)' 카테고리의 다른 글

13. reverseParentheses  (1) 2017.06.17
12. sortByHeight  (1) 2017.06.08
10. commonCharacterCount  (1) 2017.06.08
9. allLongestStrings  (1) 2017.06.08
8. matrixElementsSum  (1) 2017.06.08
Posted by EL2A