Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.

book
Lucky Ticket Validator

Given a ticket string consisting of six digits, return YES if its lucky and NO in the opposite case. A ticket is considered lucky if the sum of the first three digits is equal to the sum of the last three digits, even when there are leading zeroes.

Example 1

Input:

213132

Output:

YES

Example 2

Input:

973894

Output:

NO
main.cpp

main.cpp

C++

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt