Hello! I'm trying to submit a solution to the PALIN problem (The Next Palindrome). My solution wouldn't run in the specified time limit, and I think it's because of how I do I/O.
This is my code:
if __name__ == '__main__':
import sys
numCases = int(sys.stdin.readline().strip())
for line in sys.stdin.readlines(numCases):
print nextPalindrome(int(line.strip()))
I've tried a couple of variations on this, as well. How can I tell if my program is too slow because of the algorithm I use, or because I/O is not functioning properly?
Thank you for your time!