Leaderboard
Showing:
Handle Score
@Ibrahim Nash 6379
@blackshadows 6329
@mb1973 5358
@Quandray 5231
@akhayrutdinov 5111
@saiujwal13083 4510
@sanjay05 3762
@marius_valentin_dragoi 3522
@sushant_a 3459
@verma_ji 3357
@KshamaGupta 3318
Complete Leaderboard
Crack the series
Easy Accuracy: 49.18% Submissions: 45 Points: 2

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.

Example 1:

Input: N = 1
Output: 2 
Explanation: First term of the series is 2.

Example 2:

Input: N = 2
Output: 2
Explanation: Second term of the series is 2. 


Your Task:  
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)

Constraints:
1<= N <=12

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Crack the series

Output Window