Luhn Algorithm (Mod 10) Credit Card Number Verification
Problem Statement
Implement the **Luhn Algorithm (Mod 10 Checksum)** used by financial networks to validate payment card numbers against accidental transcription errors.
### Algorithm
1. Starting from the rightmost digit and moving left:
2. Double the value of every second digit.
3. If doubling a digit results in a number greater than 9, sum its digits (or subtract 9).
4. Sum all digits (both unchanged and doubled).
5. If the total modulo 10 is equal to 0, the number is valid.
### Input Format
- A single line containing the card number string of digits.
### Output Format
- Print `true` if valid, or `false` if invalid.
### Constraints
- `1 <= card_number.length <= 19`
- Card number consists only of digits `0-9`.
Sample Cases
Example 1Sample Case
Input: 79927398713
Output: true
Example 2Sample Case
Input: 79927398710
Output: false
Example 3Sample Case
Input: 79927398714
Output: false
Example 4Sample Case
Input: 79927398711
Output: false
Constraints
Runtime Limit: 2000 ms per test batch
Memory Limit: 256 MB
Standard I/O stream reading
Official submissions are evaluated against hidden test cases on the server to verify time & memory complexity.