Markov takes out his Snakes and Ladders game, stares at the board and wonders: "If I can always roll the die to whatever number I want, what would be the least number of rolls to reach the destination?" RulesThe game is…
You are given a tree (a simple connected graph with no cycles). Find the maximum number of edges you can remove from the tree to get a forest such that each connected component of the forest contains an even number of…
Consider an undirected graph where each edge is the same weight. Each of the nodes is labeled consecutively. You will be given a number of queries. For each query, you will be given a list of edges describing an…
The member states of the UN are planning to send people to the moon. They want them to be from different countries. You will be given a list of pairs of astronaut ID's. Each pair is made of astronauts from the same…
The Ruler of HackerLand believes that every citizen of the country should have access to a library. Unfortunately, HackerLand was hit by a tornado that destroyed all of its libraries and obstructed its roads! As you are…