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
- 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
- Given a string and an integer k, find the kth sub-string when all the sub-strings are sorted according to the given condition
- 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
- Find the character in first string that is present at minimum index in second string
- Queries to find the last non-repeating character in the sub-string of a given string
- Find the smallest window in a string containing all characters of another string
- Queries to find the first non-repeating character in the sub-string of a string
- Find a palindromic string B such that given String A is a subsequense of B
- Minimal moves to form a string by adding characters or appending string itself
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.