# -*- coding:utf-8 -*- class ReverseEqual: def checkReverseEqual(self, s1, s2): # write code here return len(s1)==len(s2) and s2 in (s1+s1)#妙啊!
class ReverseEqual { public: bool checkReverseEqual(string s1, string s2) { // write code here int len1=s1.size(); int len2=s2.size(); if(len1!=len2) return false; if(len1==0 || len2==0) return false; string s=s1+s1; if(s.find(s2)==-1) return false; else return true; } };