6 kyu
Difference of perfect squares displayed as sum of consecutive odd numbers
218 of 402Cloud Walker
Loading description...
Algorithms
Mathematics
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This comment has been hidden.
Nice kata was fun after understanding what was i supposed to do :D
Thank you.
Python translation: https://www.codewars.com/kumite/63d05bbaf930c422a58320a0?sel=63d05bbaf930c422a58320a0
If you want to add your translation you have my permission. JavaScript is the only language I am versed in. I will trust your judgement. I have little time now so please do what you think needs to be done.
Approved. Hope all is good now.
This needs to be more specific.
For instance:
given 10, 0 Log 50 expected undefined to deeply equal '10^2 - 0^2 = 1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17 + 19 = 100'
100 can be interpreted as 49 + 51 or the given answer.
Specific-ations. At the very top, The "Specifications" bulleted list states that the "first input minus the second input...". Please read more carefully.
The title's misleading; i.e, it's less about figuring out a mathematical problem and more about implementing an algorithm.
In the examples, why does
27 + 29
not work for the first example? How do you decide how many odd numbers you need to return? And why doesn't 51 just return51
? Since it's odd?I maybe understand with the asterisked sentence in the notes... but that needs to be further up. Super confusing.
In the Description at the bottom, after the asterisk it states: The first input minus the second input reveals the number of consecutive odd numbers required for the solution. (otherwise all of the odd solutions would deteriorate into one odd number)Also consider this kata is categorized as a puzzle and requires a bit of deduction from the user. Maybe I should edit and bring the info after the asterisk to the top? Buried down there, probably easy to miss.
Yes, put the "notes" above the "examples" and perhaps in a bulleted list. And perhaps also call those notes "the specification" instead.
Okay. Might take me an hour or two. Operating from my phone and not enough sleep.
Okay. revised with the bulleted list. Looks like a good improvement.
I wasn't expecting any reply! Thanks very much. I think this is a good improvement.
Sure thing. It made for a better looking, more concise description. Thank you. Would have replied sooner but im on my phone todsy and its difficult to edit and text here on codewars. Cursor is hyper and jumps around.
Consider adding the
math
tag.Added.
I have made all necessary edits but still see that my kata says it has issues. Did I miss something?
you should no longer have open issues
Random test case should show the input in the title of the test case instead of
random test case
. I suggest you use the same format as your fixed testsgiven ${sqr1}, ${sqr2}
.That works great.Thanks. So each time i edit i will need to re-publish? How can i get back to the Editing blocks for this particular kata? im working in a separate browser so i dont lose the edit page for this kata. Saved the address and that works so far, but each time i leave or and try to come back it asks if i want to "keep" the data i have so far. Just worried ill lose the whole kata and time invested. The save button is gone and i only see republish or unpublish.
The re-publish button does the same thing as the save button (except for now your changes are beign published)
Publishing auto-saves it, so you won't lose the kata.
Trying to summarise the various steps/states of the editor here:
if the kata is already published (this means: either in Beta, or fully approved), then yes each time you make an edit in your editor, you will need to click Re-publish button - this saves the edits and makes them available to the users who access your kata.
If you Unpublish, then the Beta goes back to Draft mode: the main reason for doing this is to "hide" your kata from downvotes if it has lots of issues. Basically, if you publish to Beta and nothing works correctly, description is bad, it's a duplicate etc etc then you will probably find that your kata gets downvoted, which in turn will make it almost impossible to reach the satisfaction % to get approval. Therefore, if you get a friendly reviewer who suggests Unpublish in order to make major changes to the kata, it can be a good idea to Unpublish and keep working on it. On the other hand, if it's just a typo or you're missing 1-2 test cases, then you can just "edit + Republish" as described above.
the thing about "keep" message appearing is (AFAIK) a bug; someone who has been on CW for longer than me can confirm, but basically if you just always click keep it seems to behave OK. I still keep local copies of all my katas though, so I can repaste them if I ever deleted by accident in the CW editor.
Appreciate the explanation. Very enlightening. One question though..if you need to edit your kata, how do you get back to the editing page for that particular kata? I mean, where on codewars site are the links to get back to a kata that needs editing?
you must resolve an issue, or wait for the issuer to resolve it for you
Thank you,everyone.Voile. Just republished after adding the code. About to test it.
These lines belong to the test fixture, not user code.