Given the series as follows 2 2 4 8 16 512....... Identify the Nth term of the series. Answers can be very large use BigInt in Java.
Input: N = 1
Explanation: First term of the series is 2.
Input: N = 2
Explanation: Second term of the series is 2.
You dont need to read input or print anything. Complete the function NthTerm() which takes N as input parameter and returns the Nth term of the series.
Expected Time Complexity: O(logn*logn)
Expected Auxiliary Space: O(1)
1<= N <=12
We strongly recommend solving this problem on your own before viewing its editorial. Do you still
want to view the editorial?
Login to access your submissions.