class Solution:
def isCircularSentence(self, sentence: str) -> bool:
sentences = sentence.split()
N = len(sentences)
for i in range(N-1):
if sentences[i][-1] != sentences[i+1][0]:
return False
return sentence[0] == sentence[-1]
class Solution:
def isCircularSentence(self, sentence: str) -> bool:
sentences = sentence.split()
return all(sentences[i][-1] == sentences[i+1][0] for i in range(len(sentences)-1)) and sentence[0] == sentence[-1]