Given a string str and a corner string cs, we need to find out whether the string str starts and ends with the corner string cs or not.
Input : str = "geeksmanishgeeks", cs = "geeks" Output : Yes Input : str = "shreya dhatwalia", cs = "abc" Output : No
- Find length of given string str as well as corner string cs. Let this length be n and cl respectively.
- If cl>n, return false as cs can’t be greater than str.
- Otherwise, find the prefix and suffix of length cl from str. If both prefix and suffix match with corner string cs, return true otherwise return false.
- Maximum length palindromic substring such that it starts and ends with given char
- Program to build a DFA that checks if a string ends with "01" or "10"
- Ways to split string such that each partition starts with distinct character
- Count substrings that starts with character X and ends with character Y
- Find the longest sub-string which is prefix, suffix and also present inside the string
- Find the longest sub-string which is prefix, suffix and also present inside the string | Set 2
- String Range Queries to find the number of subsets equal to a given String
- Find the character in first string that is present at minimum index in second string
- Find the count of palindromic sub-string of a string in its sorted form
- Find length of longest subsequence of one string which is substring of another string
- Given a string and an integer k, find the kth sub-string when all the sub-strings are sorted according to the given condition
- Queries to find the last non-repeating character in the sub-string of a given string
- Find Kth largest string from the permutations of the string with two characters
- Queries to find the first non-repeating character in the sub-string of a string
- Find the smallest window in a string containing all characters of another string
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.