Cerinta completa The evil forest is guarded by vicious mandragoras. Garnet and her pet must make a journey through. She starts with health point () and experience points. As she encouters each mandragora, her choices are: Garnet’s pet eats mandragora
Maximizing XOR
Cerinta completa Given two integers, and , find the maximal value of xor , written , where and satisfy the following condition: For example, if and , then Our maximum value is . Function Description Complete the maximizingXor function in
Matrix
Cerinta completa The kingdom of Zion has cities connected by bidirectional roads. There is a unique path between any pair of cities. Morpheus has found out that the machines are planning to destroy the whole kingdom. If two machines can
Mixing proteins
Cerinta completa Some scientists are working on protein recombination, and during their research, they have found a remarkable fact: there are 4 proteins in the protein ring that mutate after every second according to a fixed pattern. For simplicity, proteins
Matrix Layer Rotation
Cerinta completa You are given a 2D matrix of dimension and a positive integer . You have to rotate the matrix times and print the resultant matrix. Rotation should be in anti-clockwise direction. Rotation of a matrix is represented by
Lucky Numbers
Cerinta completa A number is called lucky if the sum of its digits, as well as the sum of the squares of its digits is a prime number. How many numbers between and inclusive, are lucky? For example, and .
Minimum Penalty Path
Cerinta completa Consider an undirected graph containing nodes and edges. Each edge has an integer cost, , associated with it. The penalty of a path is the bitwise OR of every edge cost in the path between a pair of
Longest Mod Path
Cerinta completa In the middle of a nightmare, Maxine suddenly finds herself in a mysterious room with the following items: A piece of paper with the word score and the integer written on it. A map of the castle where
Making Anagrams
Cerinta completa We consider two strings to be anagrams of each other if the first string’s letters can be rearranged to form the second string. In other words, both strings must contain the same exact letters in the same exact
Mark and Toys
Cerinta completa Mark and Jane are very happy after having their first child. Their son loves toys, so Mark wants to buy some. There are a number of different toys lying in front of him, tagged with their prices. Mark
