![]() We can see that in a random choice, the optimal way would be to pick a monster with lower health and reduce the health of the other monster till its health becomes less than the health of the attacking monster. Suppose we have two monsters with health h1 and h2, and let’s say h2 > h1. Once this crucial observation is made problem becomes easy. Recommended: Please try your approach on first, before moving on to the solution.Īpproach: It can be observed from the problem that one has to find a certain value of health of the monster, let’s say k which can kill other monsters including self. Asymptotic Analysis (Based on input size) in Complexity Analysis of Algorithms.Introduction to Recursion - Data Structure and Algorithm Tutorials. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |