Skip to content

Instantly share code, notes, and snippets.

@yasuharu519
Created July 26, 2012 05:48
Show Gist options
  • Save yasuharu519/3180474 to your computer and use it in GitHub Desktop.
Save yasuharu519/3180474 to your computer and use it in GitHub Desktop.
# -*- coding:utf-8 -*-
def isCyclicNum(num):
if str(num) == str(num)[::-1]:
return True
else:
return False
def main():
ans = 0
for i in xrange(999, 99, -1):
for j in xrange(999, 99, -1):
if ans > i*j:
continue
if isCyclicNum(i * j):
ans = max(ans, i * j)
return ans
if __name__ == "__main__":
print main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment