In a social network, online communities refer to the group of people with an interest towards the same topic.
People connect with each other in a social network. A connection between Person I and Person J is represented as C I J. When two persons belonging to different communities connect, the net effect is merger of both communities which I and J belonged to.
We are only interested in finding out the communities with the member count being an even number. Your task is to find out those communities.
Given a square maze (A) of dimension N, every entry (Aij) in the maze is either an open cell 'O' or a wall 'X'. A rat can travel to its adjacent locations (left, right, top and bottom), but to reach a cell, it must be open. Given the locations of R rats, can you find out whether all the rats can reach others or not.
Zoya has developed a new game called Zombie World. The objective of the game is to kill all zombies in given amount of time. More formally,
· N represents the total number of zombies in the current level
· T represents the maximum time allowed for the current level
· P represents the initial energy level a player starts with
· Ei defines the energy of the i-th zombie
· D defines the minimum energy the player needs, to advance to the next level
In order to defeat a zombie, player energy must be at least equal to the i-th zombie's energy. If the player succeeded in defeating the zombie, then he will be awarded with an additional energy equal to the difference between current zombie energy and the player energy.
One unit of time will be taken to complete the fight with a single zombie.
Rules of the game:-
· At any given time, a player can fight with only one zombie
· Player is allowed to choose any one zombie to fight with.
Your task is to determine whether the player will advance to the next level or not, if he plays optimally.
" MATHEMATICS can be your best friend if you will use it frequently but it can be your worst enemy if you will neglect using it daily."
Elmor Earl F.Leonor
As a toddler when I looked at my fingers and wondered,
you helped me to count numbers.
As a kid when I looked at stars with awe,
you helped me and told that's infinity.
As a teen when my confused mind often went blank,
you told that's zero and eventually