Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify is not working for me #11

Open
sfeldkamp opened this issue Aug 10, 2018 · 1 comment
Open

Verify is not working for me #11

sfeldkamp opened this issue Aug 10, 2018 · 1 comment

Comments

@sfeldkamp
Copy link

When I train this kata (an example, they all have the same problem).

{
  "_data": {
    "success": true,
    "name": "Square(n) Sum",
    "slug": "square-n-sum",
    "description": "Complete the `squareSum`/`square_sum`/`SquareSum` method so that it squares each number passed into it and then sums the results together.\n\nFor example:\n```javascript\nsquareSum([1, 2, 2]); // should return 9\n```\n```coffeescript\nsquareSum([1, 2, 2]) # should return 9\n```\n```python\nsquare_sum([1, 2, 2]) # should return 9\n```\n```ruby\nsquareSum([1, 2, 2]) # should return 9\n```\n```crystal\nsquareSum([1, 2, 2]) # should return 9\n```\n```haskell\nsquareSum [1, 2, 2] -- should return 9\n```\n```dart\nsquareSum([1, 2, 2]); // should return 9\n```\n```rust\nsquare_sum([1, 2, 2]) // should return 9\n```\n```cpp\nsquare_sum({1, 2, 2}); // should return 9\n```\n```csharp\nKata.SquareSum(new int[] {1, 2, 2}) # should return 9\n```\n```c\nconst int values[] = { 1, 2, 2 };\nconst size_t count = sizeof(values)/sizeof(values[0]);\n\nsquare_sum(values, count); // should return 9\n```\n",
    "author": null,
    "rank": -8,
    "averageCompletion": 39604.54756929734,
    "tags": [
      "Fundamentals",
      "Arithmetic",
      "Mathematics",
      "Algorithms",
      "Logic",
      "Numbers",
      "Arrays",
      "Data Types",
      "Lists",
      "Data Structures"
    ],
    "session": {
      "projectId": "5b6d9b0d68cb2eef1b0000e4",
      "solutionId": "5b6d9b0eb3d9774eaf000002",
      "setup": "function squareSum(numbers){\n\n}",
      "exampleFixture": "Test.assertEquals(squareSum([1,2]), 5)\nTest.assertEquals(squareSum([0, 3, 4, 5]), 50)",
      "code": null,
      "recentlyAttempted": null
    }
  },
  "name": "Square(n) Sum",
  "description": "Complete the `squareSum`/`square_sum`/`SquareSum` method so that it squares each number passed into it and then sums the results together.\n\nFor example:\n```javascript\nsquareSum([1, 2, 2]); // should return 9\n```\n```coffeescript\nsquareSum([1, 2, 2]) # should return 9\n```\n```python\nsquare_sum([1, 2, 2]) # should return 9\n```\n```ruby\nsquareSum([1, 2, 2]) # should return 9\n```\n```crystal\nsquareSum([1, 2, 2]) # should return 9\n```\n```haskell\nsquareSum [1, 2, 2] -- should return 9\n```\n```dart\nsquareSum([1, 2, 2]); // should return 9\n```\n```rust\nsquare_sum([1, 2, 2]) // should return 9\n```\n```cpp\nsquare_sum({1, 2, 2}); // should return 9\n```\n```csharp\nKata.SquareSum(new int[] {1, 2, 2}) # should return 9\n```\n```c\nconst int values[] = { 1, 2, 2 };\nconst size_t count = sizeof(values)/sizeof(values[0]);\n\nsquare_sum(values, count); // should return 9\n```\n",
  "slug": "square-n-sum",
  "setup": "function squareSum(numbers){\n\n}",
  "tests": "Test.assertEquals(squareSum([1,2]), 5)\nTest.assertEquals(squareSum([0, 3, 4, 5]), 50)",
  "solutionId": "5b6d9b0eb3d9774eaf000002",
  "projectId": "5b6d9b0d68cb2eef1b0000e4",
  "rank": "8"
}

And provide this solution in an index.js file.

function squareSum(numbers){
	return numbers.reduce(function(sum, number){
		return sum + (number*number)
	}, 0);
}

and verify as

$ codewars verify index.js

I get the following result:

Nope. Your solution is incorrect. :(

## Stack trace

undefined

## Tests

Sometimes this error appears:

(node:90314) MaxListenersExceededWarning: Possible EventEmitter memory leak detected.  11 exit listeners added.  Use emitter.setMaxListeners() to increase limit

The solution is verified and passes if I paste it into the Codewars.com browser editor.

@sfeldkamp
Copy link
Author

OSX 10.13.3
Node v8.11.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant