Cerinta completa A regular expression is used to describe a set of strings. For this problem the alphabet is limited to ‘a’ and ‘b’. We define to be a valid regular expression if: 1) is “” or ““. 2) is
Counting Road Networks
Cerinta completa Lukas is a Civil Engineer who loves designing road networks to connect cities numbered from to . He can build any number of bidirectional roads as long as the resultant network satisfies these constraints: It must be possible
Counter game
Cerinta completa Louise and Richard have developed a numbers game. They pick a number and check to see if it is a power of . If it is, they divide it by . If not, they reduce it by the
Counting Sort 1
Cerinta completa Comparison Sorting Quicksort usually has a running time of , but is there an algorithm that can sort even faster? In general, this is not possible. Most sorting algorithms are comparison sorts, i.e. they sort a list just
Coprime Paths
Cerinta completa You are given an undirected, connected graph, , with nodes and edges where . Each node is initially assigned a value, , that has at most prime divisors. You must answer queries in the form u v. For
Correctness and the Loop Invariant
Cerinta completa In the previous challenge, you wrote code to perform an Insertion Sort on an unsorted array. But how would you prove that the code is correct? I.e. how do you show that for any input your code will
Computer Game
Cerinta completa Sophia is playing a game on the computer. There are two random arrays A & B, each having the same number of elements. The game begins with Sophia removing a pair (Ai, Bj) from the array if they
Count Scorecards
Cerinta completa In a tournament, players play against each other exactly once. Each game results in exactly one player winning. There are no ties. You have been given a scorecard containing the scores of each player at the end of
Count Luck
Cerinta completa Ron and Hermione are deep in the Forbidden Forest collecting potion ingredients, and they’ve managed to lose their way. The path out of the forest is blocked, so they must make their way to a portkey that will
Compare the Triplets
Cerinta completa Alice and Bob each created one problem for HackerRank. A reviewer rates the two challenges, awarding points on a scale from 1 to 100 for three categories: problem clarity, originality, and difficulty. The rating for Alice’s challenge is
