← All problemsSign in

Find Last Digit (keteki)

This is a sequence 1, N+1, 2, N+2, 3, N+3, 4, N+4, 5, ..... N, 2*N Input is two consecutive numbers in the sequence, first number in odd position and second number in even position, print the last digit in the sequence. The two consecutive numbers would be on a newline separated by a space. Note: Long value. ###Constraints - $1 \leq 2*N \leq 1E12$ (10 to the power 12) ###Subtasks 5 subtask

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start