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.
How do I use this section?
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...
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...
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,...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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....
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...
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...
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...