HTMLify
LeetCode - Circular Sentence - Python
Views: 397 | Author: abh
1 2 3 4 5 6 7 8 9 | class Solution: def isCircularSentence(self, sentence: str) -> bool: sentence = sentence.split(" ") if sentence[0][0] != sentence[-1][-1]: return False for i in range(len(sentence)-1): if sentence[i][-1] != sentence[i+1][0]: return False return True |