Circular Sentence Problem

Circular Sentence Problem — ExecCode Easy DSA Practice

Solve the Circular Sentence problem on ExecCode. Free online easy DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given a string sentence, return true if it is circular. Your task is to otherwise, return false. A sentence is a list of words that are separated by asingle space with no leading or trailing spaces. - For example, "Hello World", "HELLO", "hello world hello world" are all sentences. Words consist of only uppercase and lowercase English letters. Uppercase and lowercase English letters are considered different.

Examples

Input {"sentence": "leetcode exercises sound delightful"}; Output True. Input {"sentence": "eetcode"}; Output True

Constraints

1 <= sentence.length <= 500 sentence consist of only lowercase and uppercase English letters and spaces. The words in sentence are separated by a single space. There are no leading or trailing spaces.

Practice Circular Sentence free on ExecCode. Browse DSA problems, topic map, and placement guides.