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…
Sorting is useful as the first step in many different tasks. The most common task is to make finding things easier, but there are other uses as well. In this case, it will make it easier to determine which pair or pairs…
A numeric string, , is beautiful if it can be split into a sequence of two or more positive integers, , satisfying the following conditions: for any (i.e., each element in the sequence is more than the previous…
A weighted string is a string of lowercase English letters where each letter has a weight. Character weights are to from to as shown below: We define the following terms: The weight of a string is the sum of the weights…
Happy Ladybugs is a board game having the following properties: The board is represented by a string, , of length . The character of the string, , denotes the cell of the board. If is an underscore (i.e., _), it means…
Bob has a strange counter. At the first second, it displays the number . Each second, the number displayed by the counter decrements by until it reaches . The counter counts down in cycles. In next second, the timer…
Manasa is out on a hike with friends. She finds a trail of stones with numbers on them. She starts following the trail and notices that any two consecutive stones' numbers differ by one of two values. Legend has it that…
An integer is a divisor of an integer if the remainder of . Given an integer, for each digit that makes up the integer determine whether it is a divisor. Count the number of divisors occurring within the integer. Note…
Flatland is a country with a number of cities, some of which have space stations. Cities are numbered consecutively and each has a road of length connecting it to the next city. It is not a circular route, so the first…
Emma is playing a new mobile game that starts with consecutively numbered clouds. Some of the clouds are thunderheads and others are cumulus. She can jump on any cumulus cloud having a number that is equal to the number…
Lilah has a string, , of lowercase English letters that she repeated infinitely many times. Given an integer, , find and print the number of letter a's in the first letters of Lilah's infinite string. For example, if…
Check Tutorial tab to know how to to solve. You are given a string consisting only of digits 0-9, commas ,, and dots . Your task is to complete the regex_pattern defined below, which will be used to re.split() all of…
The Utopian Tree goes through 2 cycles of growth every year. Each spring, it doubles in height. Each summer, its height increases by 1 meter. Laura plants a Utopian Tree sapling with a height of 1 meter at the onset of…
ABCXYZ company has up to employees. The company decides to create a unique identification number (UID) for each of its employees. The company has assigned you the task of validating all the randomly generated UIDs. A…
Lily likes to play games with integers. She has created a new game where she determines the difference between a number and its reverse. For instance, given the number , its reverse is . Their difference is . The number…
A Discrete Mathematics professor has a class of students. Frustrated with their lack of discipline, he decides to cancel class if fewer than some number of students are present when class starts. Arrival times go from…
Given an array of integers, find and print the maximum number of integers you can select from the array such that the absolute difference between any two of the chosen integers is less than or equal to . For example, if…
Lexicographical order is often known as alphabetical order when dealing with strings. A string is greater than another string if it comes later in a lexicographically sorted list. Given a word, create a new word by…
You wish to buy video games from the famous online video game store Mist. Usually, all games are sold at the same price, p dollars. However, they are planning to have the seasonal Halloween Sale next month in which you…
We define the distance between two array values as the number of indices between the two values. Given , find the minimum distance between any pair of equal elements in the array. If no such value exists, print . For…