• Skip to primary navigation
  • Skip to content
  • Skip to footer
Xuanken's Space Xuanken's Space
  • About
  • Blog
  • Coding Exercises
  • Projects
    1. Home
    2. /
    3. Exercises
    4. /
    5. Odd Palindrome
    Xuanken Tay

    Xuanken Tay

    Software engineer who likes statistics, machine learning, DevOps and the cloud

    • Sydney, AU
    • GitHub
    • LinkedIn
    • Email

    Odd Palindrome

    July 23, 2022 less than 1 minute read

    Given a string s, return whether all its palindromic substrings have odd lengths.

    Constraints

    • n ≤ 100,000 where n is the length of s

    https://binarysearch.com/problems/Odd-Palindrome

    Examples

    Example 1

    Input

    • s = aa

    Output

    • answer = False

    Example 2

    Input

    • s = bab

    Output

    • answer = True

    Solution

    Tags: string

    Categories: exercises

    Updated: July 23, 2022

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    Leave a comment

    Read more

    Anagram Substrings

    October 13, 2022 less than 1 minute read

    Given two strings s0 and s1, return the number of substrings where s1 contains any anagram of s0.

    Anagram Partitioning

    September 27, 2022 1 minute read

    You are given two non-empty strings a and b that are the same length. Partition them into substrings such that each pair of a and b’s substring is the same s...

    String Equivalence Relations

    September 25, 2022 2 minute read

    You are given three lowercase alphabet strings a, b and target. Strings a and b have the same length and are defined to be equivalent: a[i] = b[i]. For examp...

    Minimum Window Substring

    August 31, 2022 less than 1 minute read

    Given two lowercase alphabet strings a and b, return the length of a minimum substring in a that contains all the characters of b.

    • Follow:
    • GitHub
    • LinkedIn
    • Feed
    © 2024 Xuanken Tay. Powered by Jekyll & Minimal Mistakes.