Posts

Showing posts with the label Solutionforhackerrank

Strange Counter

Image
           Hacker Rank Solution              Strange Counter Hey guys ,welcome to another blog on hacker rank solution . this time we gonna discuss a hacker rank algorithim problem, which is named as Strange Counter Dashboard> Algorithms> Implementation >Strange Counter Solution:                  This one is little tricky question , After a close observation one will find it easy. the first solution arises in mind is by iterating through for loop till i==t and setting intital-value to 1 and count=3 and decreasing the value of "vount" by 1 at each iteration and as the value of "count" equals to 1 , we will double the initial-value and will initialise count to initial value.                                   But here a problem arises , which is time complexity , iter...

Happy Ladybugs

Image
                      Hacker Rank Solution  Happy Ladybugs Hey guys ,welcome to another blog on  hacker rank solution . this time we gonna discuss a hacker rank  algorithim  problem, which is named as  Happy Ladybugs. Problem: Problem Breakdown: First of all let us understand the problem statement---- As described in the question that ladybugs is board game and the board is represented by a String b , each Charcter of string shows the type(by color) of ladybug(insect) at that place. for ex if any charcter of the String is 'X' ,then that ladybug is of color X. There can be any of the 26 types of ladybugs (i.e. UpperCase alphabates i.e. A to Z) If any character of string is underscore (' _ ') then it represent an empty place. As described above that we have to determine that all the ladybugs in the string are happy or not ,if not then they can be made happy through some no....