2580. Circular Sentence
My accepted Python solution to LeetCode problem 2580, Circular Sentence, running in 0ms.
- Difficulty: Easy
- Python
- Runtime 0ms
- Memory 17.6MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 17.6MB, accepted 2025-12-31.
class Solution:
def isCircularSentence(self, sentence: str) -> bool:
words = sentence.split()
n = len(words)
for i in range(n):
if words[i][-1] != words[(i + 1) % n][0]:
return False
return True