Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The question is poorly written.
It's unclear what the "parameter" is.
Is it 10 (the "nth" term)
or a series(unspecified)
or the series given as an example
or something else?
Please have someone review your kata before it's published.
PLEASE!
Basic Test Cases
Test Passed
True should equal False
Test Passed
Test Passed
I believe "a" and "c" conform:
1 element each
values are different
lengh of each element string == 1
Why do they not? Help please!
Huge Values of n (From 100000 up to 1000000)
STDERR
/workspace/default/tests.py:18: DeprecationWarning:
np.bool
is a deprecated alias for the builtinbool
. To silence this warning, usebool
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.bool_
here.Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
sieve = numpy.ones(n // 3 + (n % 6 == 2), dtype=numpy.bool)
Execution Timed Out (12000 ms)
Test routine failed to generate large primes:- Problem?
TypeError: find_screen_height() takes 1 positional argument but 2 were give
I pass ONE arg: [1024, "4:3"] i.e.= ONE list with 2 elements
Comment?
217 , ratio solution is 32:8
Should it be reduced to 4:1?
This comment is hidden because it contains spoiler information about the solution
error in test routine:
Traceback (most recent call last):
File "/workspace/default/tests.py", line 2, in
from solution import digits_product
File "/workspace/default/solution.py", line 15
pass # code away!
^
IndentationError: unindent does not match any outer indentation level
:There are many errors in the solution to the last sample, indicated by '*':
: "103 -> 10 -> 1 -> 1, 4 elements altogether."
4 elements??
10,1,1 = 3 elements
def fn(arr):
print("In fn:", arr)
return
for n in range(len(tests)):
# an array of strings NOT two arrays
data = tests[n] # TWO arrays/lists
print()
print("Data[0] (The Problem) =", data[0])
print("Data[1] (The Solution??) =", data[1])
pass
'''
1.The convention in Codewars is that the sample data
is presented as ,.
You have observed this in your INSTRUCTION SECTION.
your check/evaluation/validation of the submitted code has a simple bug.
You REVERSE the itemS, and my code fails.
OF COURSE IT FAILS!!
FIX YOUR DAMNED CODE AND STOP BEING SO PIG-HEADED ABOUT IT.
THIS IS MY LAST MISSIVE ON THIS MATTER.
THE MORE YOU PROTEST, THE WORSE YOU LOOK.
It's said,
"When you're dead, you don't know it, but other people do."
It's the same when you're stupid!
Data[0] (The Problem) = ['i', 'to', 'beg', 'life']
Data[1] (The Solution??) = ['beg', 'life', 'i', 'to']
Passing in the twin array:
In fn: [['i', 'to', 'beg', 'life'], ['beg', 'life', 'i', 'to']]
[ Answer ], [ Problem ]
'''
This comment is hidden because it contains spoiler information about the solution
7 kyu - Sort by String length
What you are saying is that this ONE kata can present the data in reverse, contrary to every other kata in the system, WITHOUT EXPLANATION that this is the case.
Clearly your evaluation code is WRONG.
It indexes the two arrays in reverse. Easy to fix!
How can you pretend to defend such an obvious error.
Your explanation is unacceptable and should be reviewed by your peers.
If you have a look at my profile, you will see that at 4kyu I am no longer a novice Please do not insult me with yout puerile responses.
The argument passed to the fn is already sorted BY LENGTH.
["i", "to", "beg", "life"] (tests[0][0])
The second element, the "solution" is unsorted:
["beg", "life", "i", "to"] (tests[0][1])
Just look at the problem as listed below!!!
PLEASE!!
Is
tests = [
[["i", "to", "beg", "life"], ["beg", "life", "i", "to"]],
[["", "pizza", "brains", "moderately"], ["", "moderately", "brains", "pizza"]],
[["short", "longer", "longest"], ["longer", "longest", "short"]],
[["a", "of", "dog", "food"], ["dog", "food", "a", "of"]],
[["", "bees", "eloquent", "dictionary"], ["", "dictionary", "eloquent", "bees"]],
[["a short sentence", "a longer sentence", "the longest sentence"], ["a longer sentence", "the longest sentence", "a short sentence"]],
]
problem/soution #1
[["i", "to", "beg", "life"], ["beg", "life", "i", "to"]],
["i", "to", "beg", "life"] is already sorted by length
["beg", "life", "i", "to"] this is the task
task and solution are reversed?
def sort_by_length(arr): 7kyu
The solution in each case appears before its problem
Fix??
Loading more items...