Episode 7 — DSA with JavaScript / 7.5 — Strings

7.5 — Exercise Questions: Strings

<< Overview


Easy

E1. Reverse a String

Solution (JS)
function reverse(s) { return s.split("").reverse().join(""); }
Solution (C++)
string reverseStr(string s) { reverse(s.begin(), s.end()); return s; }

E2. Check Palindrome

Solution (JS)
function isPalin(s) {
    s = s.toLowerCase().replace(/[^a-z0-9]/g, "");
    return s === s.split("").reverse().join("");
}

E3. Count Vowels

Solution (JS)
function countVowels(s) {
    return [...s.toLowerCase()].filter(c => "aeiou".includes(c)).length;
}

E4. Capitalize First Letter of Each Word

Solution (JS)
function capitalize(s) {
    return s.split(" ").map(w => w[0].toUpperCase() + w.slice(1)).join(" ");
}

E5. Check if Two Strings are Anagrams

Solution (JS)
function isAnagram(a, b) {
    const sort = s => s.toLowerCase().split("").sort().join("");
    return sort(a) === sort(b);
}

Medium

E6. First Non-Repeating Character

Solution (JS)
function firstUniq(s) {
    const f = {};
    for (const c of s) f[c] = (f[c] || 0) + 1;
    for (const c of s) if (f[c] === 1) return c;
    return null;
}

E7. Longest Substring Without Repeating Characters

Solution (JS)
function longestUnique(s) {
    const set = new Set();
    let l = 0, max = 0;
    for (let r = 0; r < s.length; r++) {
        while (set.has(s[r])) set.delete(s[l++]);
        set.add(s[r]);
        max = Math.max(max, r - l + 1);
    }
    return max;
}

E8. String Compression

Solution (JS)
function compress(s) {
    let res = "", i = 0;
    while (i < s.length) {
        let j = i;
        while (j < s.length && s[j] === s[i]) j++;
        res += s[i] + (j - i);
        i = j;
    }
    return res.length < s.length ? res : s;
}

E9. Longest Common Prefix

Solution (JS)
function lcp(strs) {
    if (!strs.length) return "";
    let prefix = strs[0];
    for (let i = 1; i < strs.length; i++) {
        while (strs[i].indexOf(prefix) !== 0) prefix = prefix.slice(0, -1);
    }
    return prefix;
}

E10. Group Anagrams

Solution (JS)
function groupAnagrams(strs) {
    const map = {};
    for (const s of strs) {
        const key = s.split("").sort().join("");
        (map[key] ??= []).push(s);
    }
    return Object.values(map);
}

Hard

E11. Longest Palindromic Substring

Solution (JS)
function longestPalindrome(s) {
    let start = 0, maxLen = 1;
    function expand(l, r) {
        while (l >= 0 && r < s.length && s[l] === s[r]) { l--; r++; }
        if (r - l - 1 > maxLen) { start = l + 1; maxLen = r - l - 1; }
    }
    for (let i = 0; i < s.length; i++) { expand(i, i); expand(i, i + 1); }
    return s.slice(start, start + maxLen);
}

E12. Edit Distance

Solution (JS)
function editDist(s1, s2) {
    const m = s1.length, n = s2.length;
    const dp = Array.from({length: m+1}, () => Array(n+1).fill(0));
    for (let i = 0; i <= m; i++) dp[i][0] = i;
    for (let j = 0; j <= n; j++) dp[0][j] = j;
    for (let i = 1; i <= m; i++)
        for (let j = 1; j <= n; j++)
            dp[i][j] = s1[i-1] === s2[j-1] ? dp[i-1][j-1] : 1 + Math.min(dp[i-1][j], dp[i][j-1], dp[i-1][j-1]);
    return dp[m][n];
}

E13. KMP Pattern Search

Solution (JS)
function kmp(text, pattern) {
    const lps = [0]; let len = 0, i = 1;
    while (i < pattern.length) {
        if (pattern[i] === pattern[len]) { len++; lps.push(len); i++; }
        else if (len > 0) len = lps[len-1];
        else { lps.push(0); i++; }
    }
    const res = []; i = 0; let j = 0;
    while (i < text.length) {
        if (text[i] === pattern[j]) { i++; j++; if (j === pattern.length) { res.push(i-j); j = lps[j-1]; } }
        else if (j > 0) j = lps[j-1];
        else i++;
    }
    return res;
}

Additional exercise bank

EX-014

  • Problem: String exercise #14.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-015

  • Problem: String exercise #15.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-016

  • Problem: String exercise #16.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-017

  • Problem: String exercise #17.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-018

  • Problem: String exercise #18.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-019

  • Problem: String exercise #19.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-020

  • Problem: String exercise #20.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-021

  • Problem: String exercise #21.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-022

  • Problem: String exercise #22.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-023

  • Problem: String exercise #23.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-024

  • Problem: String exercise #24.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-025

  • Problem: String exercise #25.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-026

  • Problem: String exercise #26.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-027

  • Problem: String exercise #27.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-028

  • Problem: String exercise #28.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-029

  • Problem: String exercise #29.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-030

  • Problem: String exercise #30.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-031

  • Problem: String exercise #31.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-032

  • Problem: String exercise #32.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-033

  • Problem: String exercise #33.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-034

  • Problem: String exercise #34.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-035

  • Problem: String exercise #35.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-036

  • Problem: String exercise #36.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-037

  • Problem: String exercise #37.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-038

  • Problem: String exercise #38.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-039

  • Problem: String exercise #39.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-040

  • Problem: String exercise #40.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-041

  • Problem: String exercise #41.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-042

  • Problem: String exercise #42.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-043

  • Problem: String exercise #43.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-044

  • Problem: String exercise #44.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-045

  • Problem: String exercise #45.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-046

  • Problem: String exercise #46.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-047

  • Problem: String exercise #47.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-048

  • Problem: String exercise #48.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-049

  • Problem: String exercise #49.
  • Difficulty: Easy
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-050

  • Problem: String exercise #50.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-051

  • Problem: String exercise #51.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-052

  • Problem: String exercise #52.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-053

  • Problem: String exercise #53.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-054

  • Problem: String exercise #54.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-055

  • Problem: String exercise #55.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-056

  • Problem: String exercise #56.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-057

  • Problem: String exercise #57.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-058

  • Problem: String exercise #58.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-059

  • Problem: String exercise #59.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-060

  • Problem: String exercise #60.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-061

  • Problem: String exercise #61.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-062

  • Problem: String exercise #62.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-063

  • Problem: String exercise #63.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-064

  • Problem: String exercise #64.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-065

  • Problem: String exercise #65.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-066

  • Problem: String exercise #66.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-067

  • Problem: String exercise #67.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-068

  • Problem: String exercise #68.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-069

  • Problem: String exercise #69.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-070

  • Problem: String exercise #70.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-071

  • Problem: String exercise #71.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-072

  • Problem: String exercise #72.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-073

  • Problem: String exercise #73.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-074

  • Problem: String exercise #74.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-075

  • Problem: String exercise #75.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-076

  • Problem: String exercise #76.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-077

  • Problem: String exercise #77.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-078

  • Problem: String exercise #78.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-079

  • Problem: String exercise #79.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-080

  • Problem: String exercise #80.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-081

  • Problem: String exercise #81.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-082

  • Problem: String exercise #82.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-083

  • Problem: String exercise #83.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-084

  • Problem: String exercise #84.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-085

  • Problem: String exercise #85.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-086

  • Problem: String exercise #86.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-087

  • Problem: String exercise #87.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-088

  • Problem: String exercise #88.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-089

  • Problem: String exercise #89.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-090

  • Problem: String exercise #90.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-091

  • Problem: String exercise #91.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-092

  • Problem: String exercise #92.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-093

  • Problem: String exercise #93.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-094

  • Problem: String exercise #94.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-095

  • Problem: String exercise #95.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-096

  • Problem: String exercise #96.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-097

  • Problem: String exercise #97.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-098

  • Problem: String exercise #98.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-099

  • Problem: String exercise #99.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-100

  • Problem: String exercise #100.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-101

  • Problem: String exercise #101.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-102

  • Problem: String exercise #102.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-103

  • Problem: String exercise #103.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-104

  • Problem: String exercise #104.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-105

  • Problem: String exercise #105.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-106

  • Problem: String exercise #106.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-107

  • Problem: String exercise #107.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-108

  • Problem: String exercise #108.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-109

  • Problem: String exercise #109.
  • Difficulty: Medium
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-110

  • Problem: String exercise #110.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-111

  • Problem: String exercise #111.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-112

  • Problem: String exercise #112.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-113

  • Problem: String exercise #113.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-114

  • Problem: String exercise #114.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-115

  • Problem: String exercise #115.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-116

  • Problem: String exercise #116.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-117

  • Problem: String exercise #117.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-118

  • Problem: String exercise #118.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-119

  • Problem: String exercise #119.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-120

  • Problem: String exercise #120.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-121

  • Problem: String exercise #121.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-122

  • Problem: String exercise #122.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-123

  • Problem: String exercise #123.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-124

  • Problem: String exercise #124.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-125

  • Problem: String exercise #125.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-126

  • Problem: String exercise #126.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-127

  • Problem: String exercise #127.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-128

  • Problem: String exercise #128.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-129

  • Problem: String exercise #129.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-130

  • Problem: String exercise #130.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-131

  • Problem: String exercise #131.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-132

  • Problem: String exercise #132.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-133

  • Problem: String exercise #133.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-134

  • Problem: String exercise #134.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-135

  • Problem: String exercise #135.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-136

  • Problem: String exercise #136.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-137

  • Problem: String exercise #137.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-138

  • Problem: String exercise #138.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-139

  • Problem: String exercise #139.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-140

  • Problem: String exercise #140.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-141

  • Problem: String exercise #141.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-142

  • Problem: String exercise #142.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-143

  • Problem: String exercise #143.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-144

  • Problem: String exercise #144.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-145

  • Problem: String exercise #145.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-146

  • Problem: String exercise #146.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-147

  • Problem: String exercise #147.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-148

  • Problem: String exercise #148.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-149

  • Problem: String exercise #149.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-150

  • Problem: String exercise #150.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-151

  • Problem: String exercise #151.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-152

  • Problem: String exercise #152.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-153

  • Problem: String exercise #153.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-154

  • Problem: String exercise #154.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-155

  • Problem: String exercise #155.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-156

  • Problem: String exercise #156.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-157

  • Problem: String exercise #157.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-158

  • Problem: String exercise #158.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-159

  • Problem: String exercise #159.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-160

  • Problem: String exercise #160.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-161

  • Problem: String exercise #161.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-162

  • Problem: String exercise #162.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.

EX-163

  • Problem: String exercise #163.
  • Difficulty: Hard
  • Skills: String manipulation, two pointers, sliding window, hash maps.
  • Implementation: Both JS and C++.