URLify - Strings & Arrays - Data Structures Interview Question - Part 3

Опубликовано: 09 Февраль 2026
на канале: Ganesh H
100
1

Write a method to replace all the spaces in a string with ‘%20’. You may assume that the string has sufficient space at the end to hold the additional characters, and that you are given the “true” length of the string.
Example:
Input : "Mr John Smith ", 13
Output: "Mr%20John%20Smith"

00:00 - Introduction
00:12 - Problem Definition
01:45 - Brute Force Solution
06:18 - Optimization with Second Array
11:20 - Optimal Solution
21:24 - Implementation
26:48 - Testing
30:16 - Summary

————————————————————————————————————
Written Guides & Tutorials: https://tutorials.gn3.sh

NOTE: I am not a teacher by any means, these videos are just to help me improve my understanding.

Thanks for Watching!