Hard 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

What is Computer Programming and What Are Its Applications?

Definition When we ask ourselves a question such as what computer programming is, it's tempting to just look up the definition. We all sort of know what it is, but we want to get it precisely right. Let's not do that this time - let's build the definition from scratch. So, if you were to ask a layman what programmers do, they might say that t...

2. LESSON

How to Learn Python: Installation and Basics

In this lesson, we will provide an introduction to installing and working with Python, with a focus on the following key points: Installation and setup of the language on your machine. An overview of some basic features of Python programming with code examples. Python is one of the most p...

3. LESSON

Introduction to Code Variables and Assignment

In this lesson, we will discuss the use of variables and assignment operators in Python, with a focus on the following key points: What are variables and the assignment of variables in the Python programming language? Working with variables and assignment of variables in an introductory programming l...

4. LESSON

Boolean Algebra and Logic Gates

The field of mathematics known as Boolean algebra deals with logistical operations on binary variables. In other words, the functions and variables in Boolean algebra can have only one of two values – 0 or 1, where 0 represents False, and 1 represents True. Boolean algebra has been used mostly in computer programming languages. Set...

5. LESSON

Initializing Variables and Basic Math Operations

In this lesson, we will discuss basic elements in programming, with a focus on the following key points: What are variables, and how are they used in a program? Learn to work with math operations in an introductory programming language; Python. _This is a general purpose tutorial for multiple la...

6. LESSON

Constants and Literals: When and How to Use Them

In the realm of programming, constants and literals are fundamental building blocks that play a crucial role in constructing robust and reliable software applications. Understanding the distinction between these two concepts and employing them effectively is essential for aspiring software engineers. public class Main { public stati...

7. LESSON

What are Strings and String Operations?

In this lesson, we will discuss one of the basic types in programming languages, with a focus on the following key points, What are strings, and common string operations? Working with strings in one of a few introductory programming languages. _This is a general purpose tutorial for multiple lang...

8. LESSON

Introduction to Arrays and Array Operations

In this lesson, we will discuss the concept of arrays, with a focus on the following key points, What are arrays, and how are they implemented? Working with array operations in Python. For the Javascript version of this lesson, [please click here] (https://algodaily.com/lessons/introduction-array...

9. LESSON

How to Find the Minimum and Maximum Value in An Array

In this tutorial, we'll learn to find out the minimum and maximum values in an array using the following techniques. Built-in Methods Linear Search Method Divide and Conquer Single Loop Trick/ Comparison in Pairs We'll be using a few different languages to solve the problem. So without further ado, let's get started! ![Min and Max in Ar...

10. LESSON

Control Flow: If/Else and Try/Catch Statements

In this lesson, we will discuss the flow of execution of programs, with a focus on the following key points, How can the execution flow of a program be controlled? Working with if/else and try/catch statements to establish control flow in programs. For the Javascript version of this lesson, [plea...

11. LESSON

Loops and Iterations in Programming

In this lesson, we will learn about loops and iterations in programming, with a focus on the following key points, What are iterations in programming? Working with loops and related concepts in Python. For the Javascript version of this lesson, [please click here] (https://algodaily.com/lessons/l...

12. LESSON

Calling Functions: Calling, Parameters, Returning

In this lesson, we will learn about functions in a program, with a focus on the following key points, What are functions, and why do we use them? Working with function parameters, return, and call statements. _For the Javascript version of this lesson, [please click here] (https://algodaily.com/...

13. LESSON

Dictionaries and Key-Value Stores

In this lesson, we will learn about a new type of data structure called dictionaries, with a focus on the following key points, What are dictionaries and how are they used? Working with dictionaries in Python. For the Javascript version of this lesson, [please click here](https://algodaily.com/le...

14. LESSON

Understanding Mutable vs. Immutable Objects

Before discussing the difference between mutable and immutable objects, it's important that we properly define what an Object is in Object-Oriented Programming (OOP). This will serve as one of the foundations/basic concepts to fully understand the topic. So to start, an Object is a piece...

15. CHALLENGE

Max Product of Three Numbers

Given an unsorted array of integers, can you write a method maxProductOfThree(unsorted: array) to find the largest product from three of the numbers? For example, given the following array: [-1, 9, 22, 3, -15, -7] The largest product of three numbers is 2310. This results from -15 * -7 * 22. <img src="https://storage.goo...

16. CHALLENGE

Find Shortest Palindrome Possible

We have a string str like the following: `js const str = "bubble"; ` Find a way to convert it to a palindrome by inserting characters in front of it. Recall that a palindrome is defined as "a word, phrase, or sequence that reads the same backward as forward". <img src="https://storage.googleapis.com/algodailyrand...

17. CHALLENGE

Length of String Compression

Let's define the "compacting" of a string as taking an input like the following: 'sstttrrrr'. We want to take the number of sequential appearances (number of times it shows up in a row) of each letter: ` s: 2 t: 3 r: 4 ` And denote them next to the original character in the string, getting rid of the duplicates....

18. CHALLENGE

Targets and Vicinities

You're playing a game with a friend called Target and Vicinity. Target and Vicinity consists of one person thinking up a number in their head, and the other guessing that number. Sounds simple enough-- the caveat is that we also want to credit close guesses. To estimate the proximity of the guess to the actual number, we u...

19. CHALLENGE

Generate All String Permutations

Write an algorithm that takes an input string like "abc", and prints out all possible permutations of the string. A permutation of a group of elements is defined as one of the n! number possible arrangements the elements can take, where n is the number of elements in the range. We'd expect the following to hold true, note...

20. CHALLENGE

Longest Increasing Subsequence

The Longest Increasing Subsequence (LIS) is a subsequence within an array of numbers with an increasing order. The numbers within the subsequence have to be unique and in an ascending manner. It's important to note that the items of the sequence do not have to be in consecutive locations within the array. Can you write an effi...

21. CHALLENGE

Find Deletion Distance

Can you determine the deletion distance between two strings? Let's define the deletion distance as the numbers of characters needed to delete from two strings to make them equal. <img src="https://storage.googleapis.com/algodailyrandomassets/curriculum/multistep/find-deletion-distance/find-deletion-distance-4.png" class="img...

22. CHALLENGE

Levenshtein Edit Distance

An edit distance is a way to quantify how different two strings are. This is calculated using the minimum number of transformations to turn one string to another. The transformations include insertion, deletion, and substitution. So when comparing two identical strings, say cat and cat, the edit distance would be `...

23. CHALLENGE

String Breakdown

We're given a string and need to see if it can be broken down into words from a dictionary array. For example: `js const str = "applecomputer"; const dictArr = ["apple", "computer"]; stringBreakdown(str, dictArr); // true ` Assuming that there are no repeats in the dictionary array, can you write a method that will r...

24. CHALLENGE

Convert Number to Words

Can you convert a number to its text equivalent? This is otherwise known as number spelling. For example, given 1234, we expect to get "one thousand two hundred and thirty four" back....

25. CHALLENGE

Longest Palindromic Substring

We're given a string that's a mixture of several alphabetical characters. `js const str = "algototheehtotdaily"; ` Could you write a method to find the longest substring that is considered a palindrome? In the above example, it would be "totheehtot". Where there are multiple longest palindromic substrings of the sa...

26. CHALLENGE

Text Justification

Can you justify input text represented by an array of words so it looks pretty when printed and the whitespaces are balanced? For example, in the above image, we have an input array of `["wow", "s...

27. CHALLENGE

Climbing the Word Ladder

Imagine two words placed at the two ends of a ladder. Can you reach one word from another using intermediate words as rings of the ladder? Each successive or transition word has a difference of only one letter from its predecessor, and must belong to a provided dictionary. Can we achieve this using the shortest possible number of r...

28. CHALLENGE

Longest Substring With No Duplicate Characters

Given a string of characters, can you find the longest substring of the string that has no repeating characters? An example is shown below: `js lengthOfLongestSubstring("abracadabar"); // 4 becau...

29. CHALLENGE

Remove Invalid Parentheses

Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid. Return all the possible results. image For example, consider the followi...