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.
Seems harder than a 6 to me due to the sheer complexity. Fixed tests should include situations that appear in the random tests like:
Instructions confusing. Needed to read the instructions from the leetcode website https://leetcode.com/problems/two-sum/.
Shouldn't
"o.clone()"
read"original.clone()"
?This kata relies on parsing a function's
.toString()
:(The kata is not well defined: JavaScript's parameters can contain arbritrary code that will fail all existing solutions, and whose handling would require writing a complete JavaScript engine:
This is not strictly true:
though this will not make the function callable as
bar()
afterwardsnice!
Ok, I changed it to indexes. Now, I'll go back about where is the ambiguity:
ambiguity
/ˌambɪˈɡjuːɪti/
noun
the quality of being open to more than one interpretation; inexactness.
Now tell me, how would you interprete indices there if not as a synonym of indexes?
If it wasn't ambigous I wouldn't bother, but I did, didn't I?
More serious though - it was just a suggestion. According to Oracle:
"Indices" is the mathematical formulation whereas in publishing they use "indexes" (which is probably why so many people in IT consider "indices" to be more correct than "indexes").
I think that a table index is analogous to an index in a book rather than an exponent in maths, so the publishing variant is the appropriate plural to use in this context.
Furthermore, at least in Oracle, the data dictionary views are called DBA_INDEXES, ALL_INDEXES and USER_INDEXES. It is usually a good idea to employ the same terminology which the domain uses."
And Microsoft:
"Use indexes as the plural form of index. Use indices only in the context of mathematical expressions."
I think if you can spare another person ambiguity, then its worth to at least add /indexes.
Isn't indices a plural form of index? Why do you say it's ambiguous? In the description there are two examples where you can see the arrays/lists are zero-indexed.
Your description is ambigues. Use or add 'index', instead of indices. Use programing language, not mathematical if you can help it.
like me
What does (n) represent?
You should defer calculations of sqrt as late as you can (not do it right away), trying to return as early as you can, and considering various edge cases.
This comment is hidden because it contains spoiler information about the solution
So simple!!
Loading more items...