Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 372 Bytes

File metadata and controls

11 lines (8 loc) · 372 Bytes

isLucky

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 solution(n) = true; For n = 239017, the output should be solution(n) = false.