Copy Edit digitSum(1023) = 1 + 0 + 2 + 3 = 6 Given a positive integer N, find the smallest integer X strictly greater than N such that: digitSum(N) and digitSum(X) have different parity — that is, one ...
If Give an integer N . Write a program to obtain the sum of the first and last digit of this number. I didn't feel like extracting the digits so I just treated the number as a string. Easily ...