Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    Practice problems / Palindrome partitioning

    Palindrome partitioning

    Mediumbacktrackingstringdynamic programming

    Split s into contiguous parts that are each a palindrome. Return every possible split (the order of the splits doesn't matter, but parts within a split follow the word's order).

    Example 1

    Input:  s = "aab"
    Output: [["a","a","b"],["aa","b"]]

    Example 2

    Input:  s = "a"
    Output: [["a"]]

    Constraints

    • 1 ≤ s.length ≤ 12
    • Lowercase letters

    Submit checks your solution against 8 tests, including hidden ones.

    /**
     * @param {string} s
     * @return {string[][]}
     */
    function partitionPalindromes(s) {
      
    }
    
    Sign in to run
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.