Please enter your email address or userHandle.
Given a number N, find the sum of first and last digit of N.
Input: N = 12345
Explanation: 1st and last digits are 1 and 5.
Explanation: 1st and last digits are 9 and 2.
You don't need to read or print anything. Your task is to complete the function corner_digitSum() which takes N as input parameter and returns the sum of first and last digit of N.
Expect Time Compelxity: O(log10(N))
Expected Space Complexity: O(1)
1 <= N <= 109
We strongly recommend solving this problem on your own before viewing its editorial. Do you still
want to view the editorial?
Login to access your submissions.