Geeksforgeeks

X

DAYS

:

HOUR

:

MINS

:

SEC

Error

Copied to Clipboard

Given **N**, count all **‘a’**(>=1) and **‘b’**(>=0) that satisfy the condition **a ^{3} + b^{3 }= N**.

**Example 1:**

Input:N =9Output:2Explanation:There are two solutions: (a=1, b=2) and (a=2, b=1).

**Example 2:**

Input:N =27Output:1Explanation:Thereis only one solution: (a=3, b=0)

**Your Task:**

You don't need to read input or print anything. Your task is to complete the function **pairCubeCount()** which takes an Integer N as input and returns the answer.

**Expected Time Complexity:** O(cbrt(N))

**Expected Auxiliary Space:** O(1)

**Constraints:**

1 <= N <= 10^{5}

We are replacing the old Disqus forum with the new Discussions section given below.

Click here to view old Disqus comments.

Click here to view old Disqus comments.

Login to report an issue on this page.

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

YesLoading...

Pair cube count

...