Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    Practice problems / Interleaving strings

    Interleaving strings

    Mediumdynamic programmingstring

    Return true if s3 can be formed by taking all the letters of s1 and s2, each in its own order, interleaved together.

    Example 1

    Input:  s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac"
    Output: true

    Example 2

    Input:  s1 = "aabcc", s2 = "dbbca", s3 = "aadbbbaccc"
    Output: false

    Constraints

    • 0 ≤ s1.length, s2.length ≤ 100
    • 0 ≤ s3.length ≤ 200
    • Lowercase letters

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

    /**
     * @param {string} s1
     * @param {string} s2
     * @param {string} s3
     * @return {bool}
     */
    function isInterleave(s1, s2, s3) {
      
    }
    
    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.