Skip to content
  • Home
  • YouTube
  • About
  • Contact
Learn to Code and Code to Learn

Learn to Code and Code to Learn

Your Journey to Code Mastery

  • Interview Prep Sheet
    • TCP DSA 75
    • TCP DSA 150
    • TCP DSA 351
    • TCP HLD 50
    • TCP HLD 101
  • General
    • Setup
    • Mastering in C programming (Crash Course)
  • DSA Patterns
    • Fast and Slow Pointer
    • sliding window
      • fixed size sliding window
      • Variable size sliding window
  • Coding Prep
    • Leetcode Problems
      • Leetcode Practice
      • Leetcode PTOD
      • TCP DSA 150
    • GFG
      • GFG Practice
      • GFG PTOD
    • Company wise Interview Questions
      • Google
      • Microsoft
  • Programming
    • C Programming
    • C++
      • C++-11
      • c++-14
      • STL
    • Python
  • HLD
    • TCP HLD 50
    • TCP HLD 101
  • LLD
    • SOLID Principle
    • Design Pattern
      • Creational Design Patterns
        • Singleton
  • Toggle search form

Tag: string

GFG PTOD | 28 Jan | Permutations of a String

Posted on January 28, 2025January 28, 2025 By thecodepathshala No Comments on GFG PTOD | 28 Jan | Permutations of a String
void helper(int i, int n, string &s, unordered_set<string> &st, string &cur) {
        if(cur.size() == n) {
            st.insert(cur);
            return;
        }
        for(int j=i; j<n; j++) {
            swap(s[i], s[j]);
            cur.push_back(s[i]);
            helper(i+1, n, s, st, cur);
            cur.pop_back();
            swap(s[i], s[j]);
        }
    }
    vector<string> findPermutation(string &s) {
        // Code here there
        unordered_set<string> st;
        string cur;
        helper(0, s.size(), s, st, cur);
        vector<string> res(st.begin(), st.end());
        return res;
    }
Competitive Programming, DS & Algo, GFG, GFG PTOD

#796 Rotate String

Posted on January 21, 2022January 21, 2022 By thecodepathshala 4 Comments on #796 Rotate String

Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s. A shift on s consists of moving the leftmost character of s to the rightmost position. For example, if s = “abcde”, then it will be “bcdea” after one shift. Example 1: Input: s = “abcde”, goal = “cdeab” Output: true Example 2: Input: s = “abcde”, goal = “abced” Output: false Solution…

Read More “#796 Rotate String” »

Algo, Competitive Programming, DS & Algo, GFG, Leetcode Problems

#316 Remove Duplicate Letters

Posted on January 21, 2022January 21, 2022 By thecodepathshala 3 Comments on #316 Remove Duplicate Letters

Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicographical order among all possible results. Example 1: Input: s = “bcabc” Output: “abc” Example 2: Input: s = “cbacdcbc” Output: “acdb” Solution : string removeDuplicateLetters(string s) {map umap;map umap1;string result =…

Read More “#316 Remove Duplicate Letters” »

Algo, Competitive Programming, DS & Algo, GFG, Leetcode Problems

#125 Valid Palindrome

Posted on January 20, 2022January 20, 2022 By thecodepathshala 9 Comments on #125 Valid Palindrome

A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers. Given a string s, return true if it is a palindrome, or false otherwise. Example 1: Input: s = “A man, a plan, a canal: Panama” Output: true Explanation: “amanaplanacanalpanama” is…

Read More “#125 Valid Palindrome” »

Algo, Competitive Programming, DS & Algo, GFG, Leetcode Problems

#344 Reverse String

Posted on January 20, 2022January 20, 2022 By thecodepathshala 1 Comment on #344 Reverse String

Write a function that reverses a string. The input string is given as an array of characters s. You must do this by modifying the input array in-place with O(1) extra memory. Example 1: Input: s = [“h”,”e”,”l”,”l”,”o”] Output: [“o”,”l”,”l”,”e”,”h”] Example 2: Input: s = [“H”,”a”,”n”,”n”,”a”,”h”] Output: [“h”,”a”,”n”,”n”,”a”,”H”] Constraints: 1 <= s.length <= 105 s[i] is a printable ascii character. Solution :…

Read More “#344 Reverse String” »

Algo, Competitive Programming, DS & Algo, GFG, Leetcode Problems

Archives

  • May 2026
  • August 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • September 2023
  • February 2023
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021

Categories

  • Algo
  • Array in C
  • C Programming
  • C++
  • C++
  • Company Wise
  • Competitive Programming
  • Design Pattern
  • DS
  • DS & Algo
  • Fast and Slow Pointer
  • fixed size sliding window
  • General
  • GFG
  • GFG PTOD
  • HLD
  • hld101
  • Interview Prep Sheet
  • Interview Questions
  • Leetcode Problems
  • Leetcode PTOD
  • LLD
  • Low-level design
  • Mastering in C programming (Crash Course)
  • Neetcode 150
  • Programming
  • Roadmap
  • Setup
  • Setup
  • sliding window
  • SOLID Principle
  • STL
  • string in c
  • System Design
  • TCP DSA 150
  • TCP DSA 351
  • TCP DSA 75
  • TCP HLD50
  • Top X
  • Variable size sliding window

Tags

algorithm array basic c++ coding interview C Programming Crash Course data structure and algorithm design pattern dsa easy Fixed size sliding window fubctions GFD gfg GFG PTOD hard HLD jump game LC PTOD leetcode Leetcode PTOD Leetcode Top Interview 150 LLD loop loops Low-level design Mastering C Programming in 15 Days matrix medium rotate array searching&sorting sliding window solid STL string string in c sunction in c system design TCP HLD50 TCP HLD101 Template in C++ Top Top 20 coding patterns to master MAANG Interview Top interview 150

This error message is only visible to WordPress admins

Error: No videos found.

Make sure this is a valid channel ID and that the channel has videos available on youtube.com.

TCP DSA

75
150
351

TCP HLD

50
101

Recent Posts

  • CAP THEOREM
  • TCP DSA 351
  • TCP HLD 101
  • TCP HLD 50
  • TCP DSA-150

    Recent Comments

    1. Odell Volner on C program to print multiplication table of a given number
    2. Crista Diegidio on C program to print multiplication table of a given number
    3. Daniel Pauling on C program to print multiplication table of a given number
    4. Tonisha Hepp on C program to print multiplication table of a given number
    5. Jorge Layng on C program to print multiplication table of a given number

    Copyright © 2026 Learn to Code and Code to Learn.

    Powered by PressBook Blog WordPress theme