Easy Strings

A sequence of characters, either as a literal constant or as some kind of variable, that can have its elements be mutated and length changed.

Section Menu

How do I use this section?

1. LESSON

A Gentle Refresher Into Arrays

Let's take a scenic stroll through the world of arrays and strings and discover the connections between our everyday lives and computer science. We'll explore this fascinating subject through a structured and engaging lesson. Objective In this lesson, we will: Understand Arrays and Strings: Uncov...

2. LESSON

Stringing Together Strings

Arrays With Characters A word with 4 characters ['M', 'O', 'N', 'A'] in a character array can be represented as follows: You see, each character gets a place in each index. Does this seem oddly familiar? There’s a more convenie...

3. LESSON

String Manipulation: Techniques and Best Practices

Why String Manipulation Matters In the ever-evolving world of software development, string manipulation stands as a fundamental and vital skill. Strings are at the heart of human-readable data. Whether it's processing user input, reading files, generating dynamic content for web pages, or simply communicating between systems,...

4. LESSON

The Set Data Structure and Set Theory

A big portion of data structures used in modern programming are directly translated from mathematics. One crucial example is the set data structure and its operations, derived from Set Theory. Understanding this data structure requires at least some prior knowledge of the mathematical perspective of th...

5. LESSON

Using the Two Pointer Technique

The Two Pointer Technique The two pointer technique is a near necessity in any software developer's toolkit, especially when it comes to technical interviews. In this guide, we'll cover the basics so that you know when and how to use this technique. <img src="https://storage.googleapis.com/algodailyrandomassets/curriculum/arrays/two-p...

6. LESSON

A Bird’s Eye View into the Sliding Windows Algorithm Pattern

A Bird’s Eye View into Sliding Windows Objective: In this lesson, we'll cover this concept, and focus on these outcomes: You'll learn what the sliding windows algorithm pattern is. We'll show you how and when to use sliding windows in programming interviews. We'll wal...

7. LESSON

The Binary Search Technique And Implementation

Objective: This article will cover the binary search technique or pattern, one of the most commonly used methods to solve a variety of problems. By the end, you should: Be familiar with the binary search algorithm. See how it's used in interviews. Understand its complexities. Binary Sea...

8. LESSON

A Close Look at Merging Intervals

Objective: In this lesson, we'll cover this concept, and focus on these outcomes: You'll learn what merging intervals means. We'll show you how to solve similar time-based, or interval-based problems in programming interviews. Let's study the Merge Intervals algorithm which is used to...

9. LESSON

Fundamental Sorting Algorithms: Bubble and Insertion

This tutorial is about two fundamental, and basic, sorting algorithms. If you are new to sorting, I'd recommend you come up with your own algorithm for sorting arrays first, and then compare it with these algorithms. These fundamental sorting techniques give you important insights into: How to sort arrays How you can improve an algorit...

10. LESSON

Merge Sort vs. Quick Sort vs. Heap Sort

In this tutorial, we are going to discuss three O (n log n) sorting techniques, their implementations, and how we derive their runtimes. The learning objectives of this tutorial are as follows: You will be able to apply the Divide-and-Conquer approach to different sorting methods. You will be able t...

11. LESSON

Prefix, Infix, Postfix Notation and Prefix Sums

There are a few different ways to write arthimetic expressions in computer science. Infix, Postfix and Prefix notations are three different but equivalent ways of doing this and achieving the same result in the end. In this tutorial, we are going to explain these three, give some examples of their usage, and dig into the `Prefix Sums algorit...

12. LESSON

Cycling Through Cycle Sort

In this lesson, we are going to study the Cycle Sort algorithm, which is one of the less commonly used sorting algorithms, but surprisingly useful in programming interviews. The Theory Th...

13. CHALLENGE

Reverse a String

Hey there, welcome to the challenges portion of the AlgoDaily technical interview course! Over the next few days, you'll get some hands-on experience with the essential data structures and algorithms that will help you nail your interview, and land your dream software engineering job. The only way to get better at solvin...

14. CHALLENGE

Fizz Buzz

Fizz Buzz is a classic interview question that apparently many experienced engineering candidates often can't solve! Let's cover it today. We're given a number in the form of an integer n. Write a function that returns the string representation of all numbers from 1 to n based on the following rules: If it's a multiple o...

15. CHALLENGE

Reverse Only Alphabetical

Reversing Only Alphabetical Characters in a String Visual Diagram The Problem Statement You are provided with a string that's a blend of alphabetic and non-alphabetic characters. Think of a beach where you find b...

16. CHALLENGE

Is An Anagram

Understanding Anagrams: A Simple Definition An anagram is a fascinating literary device where you can rearrange the letters of a word, phrase, or name to form another meaningful sequence. Think of it as a jigsaw puzzle made of letters. For example, the word "cinema" can be rearranged to form "iceman." The Challenge: Detecti...

17. CHALLENGE

Validate Palindrome

Given a string str, can you write a method that will return True if is a palindrome and False if it is not? If you'll recall, a palindrome is defined as "a word, phrase, or sequence that reads the same backward as forward". For now, assume that we will not have input strings that contain special characters or spaces, so the...

18. CHALLENGE

Sum Digits Until One

We're provided a positive integer num. Can you write a method to repeatedly add all of its digits until the result has only one digit? Here's an example: if the input was 49, we'd go through the following steps: // start with 49 4 + 9 = 13 // since the previous addition was 13, // move onto summing 13's digits 1 + 3 = 4...

19. CHALLENGE

Detect Substring in String

How would you write a function to detect a substring in a string? If the substring can be found in the string, return the index at which it starts. Otherwise, return -1. `js funct...

20. CHALLENGE

Dollar Sign Deletion

You're given an array of strings containing alphabetical characters and certain $ characters. A $ represents a DELETE action whereby the character before it is deleted. Each of these strings will be run through a method to operate on the $ DELETE action. We want to find out if the final string is the same for all of them. Le...

21. CHALLENGE

Find First Non-Repeating Character

You're given a string of random alphanumerical characters with a length between 0 and 1000. Write a method to return the first character in the string that does not repeat itself later on. So i...

22. CHALLENGE

Find Duplicate Words

A very common interview challenge is to determine how often words appear in a given string or set of strings. Here's a version of this: return a list of duplicate words in a sentence....

23. CHALLENGE

Remove All Adjacent Duplicates In String

The Concept: Removing Adjacent Duplicates Imagine you're attending a magical carnival where you can pull adjacent duplicate letters from a string like pulling rabbits out of a hat. Exciting, right? Your goal is to get a clean string with no adjacent duplicates. In this lesson, we'll explore this problem with Linda's candy adven...

24. CHALLENGE

Custom Sort String

We are given two strings order and str, with the string order already sorted in a custom order. Permute the characters of str such that they match the custom order in which order is sorted. More specifically, if a character x occurs before a character y in order, then x should occur before y in the permuted stri...

25. CHALLENGE

Minimum Parentheses Removal

A string that contains correctly ordered parenthesis (), is a valid parenthesis string. More specifically, it must meet the following conditions: It is an empty string or contains only lowercase characters. It can be written as AB (A concatenated with B), where A and B are valid strings. It can be written as (A), where A...