Hackerrank Java Advanced Challenges: Can You Access ?

Hackerrank has sets of beautifully crafted advance java challenges for the programmers to get detailed knowledge of concepts and basic tools that would help us to solve tougher coding problems.
You can access the these set of problems here:

The problem statement is as follows:

You are given a class Solution and an inner class Inner.Private. The main method of class Solution takes an integer as input. The powerof2 in class Inner.Private checks whether a number is a power of . You have to call the method powerof2 of the class Inner.Private from the main method of the class Solution.

Sample Input

Sample Output

Solution lies here

The solution to the above problem was of only lines :

The motive of the problem was to make you aware of the nested class concept in java. The nested classes are of two types: static nested type and non-static nested type.

Leave a Reply

Your email address will not be published. Required fields are marked *