Posts

Two Characters

In this challenge, you will be given a string. You must remove characters until the string is made up of any two alternating characters. When you choose a character to remove, all instances of that character must be removed. Your goal is to create the longest string possible that contains just two alternating letters. As an example, consider the string  abaacdabd . If you delete the character  a , you will be left with the string  bcdbd . Now, removing the character  c  leaves you with a valid string  bdbd  having a length of 4. Removing either  b  or  d  at any point would not result in a valid string.

Insertion Sort - Part 2

In  Insertion Sort Part 1 , you inserted one element into an array at its correct sorted position. Using the same approach repeatedly, can you sort an entire array?

Strong Password

Louise joined a social networking site to stay in touch with her friends. The signup page required her to input a  name  and a  password . However, the password must be  strong . The website considers a password to be  strong  if it satisfies the following criteria:

Insertion Sort - Part 1

Sorting One common task for computers is to sort data. For example, people might want to see all their files on a computer sorted by size. Since sorting is a simple problem with many different possible solutions, it is often used to introduce the study of algorithms.

CamelCase

Alice wrote a sequence of words in  CamelCase  as a string of letters,  , having the following properties:

Intro to Tutorial Challenges

About Tutorial Challenges Many of the challenges on HackerRank are difficult and assume that you already know the relevant algorithms. These tutorial challenges are different. They break down algorithmic concepts into smaller challenges so that you can learn the algorithm by solving them. They are intended for those who already know some programming, however. You could be a student majoring in computer science, a self-taught programmer, or an experienced developer who wants an active algorithms review. Here's a great place to learn by doing!

Super Reduced String

Steve has a string of lowercase characters in range  ascii[‘a’..’z’] . He wants to reduce the string to its shortest length by doing a series of operations. In each operation he selects a pair of adjacent lowercase letters that match, and he deletes them. For instance, the string  aab  could be shortened to  b  in one operation.