Skip to content

Missing Test Case - 50. Pow(x, n) #6058

@Nishant1972

Description

@Nishant1972

Your LeetCode username

Category of the bug

  • Question
  • Solution
  • Language
  • [yes ] Missing Test Cases

Description of the bug

The question states to calculate x raised to power n. And when x=0 and n=0. The expected answer returns 1.00000. So, this seems to be invalid test case in the question.

Code you used for Submit/Run operation

// Two Sum
class Solution {
public:
       double myPow(double x, int n) {
        if(x ==0  &&  n ==0)
            return -1;
       return pow(x, double(n));
    }
};

Language used for code

Expected behavior

At n = 0 and x = 0, as Pow(0,0) is undefined. So, testcase must be removed.

Screenshots

Additional context

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions