6 kyu
How Many Differences of Squares?
160 of 325emaclean
Loading description...
Mathematics
Algorithms
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.
Some katas are more like a math challenge, seriously, however nice they are they won't be as rewarding.
Solved it, but it's still dumb. You either see/find the magic formula or you're screwed. No programming or algorithm challenge here.
python new test framework is required. updated in this fork
Approved
Is variants like 1^2 -0^2 valid? For n=4 the count of the variants is equal to 3. It will be impossible without them
Ruby 3.0 should be enabled, see this to learn how to do it
Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)
Enabled in this fork
I was about to ask for help but I just realized this is about difference of squares and not sum of squares. Maybe I need different kind of help.
This kata is not Sum of perfect squares ;-)
ROFL !! :satisfied:
This comment has been hidden.
This comment has been hidden.
He's solved it, I think he's just asking why it works like that.
Errrr .. Number Theory!
( That's like waving a magic wand and saying it'll be OK .. :)
I actually sat down, looked at even and odd numbers and at what possible differences of squares make up what numbers, and there is a pattern there.
I know how to factor the difference of squares. But I still don't know how to solve this problem without brute force.
Use the force! ...I mean, a search engine, and you will quickly find the theory behind it
still not seeing it.
Ruby translation kumited -- please check and approve :-)
Added.
Thanks
Haskell translation approved.
snake_case
is strongly preferred for function names in Python.Changed, any other languages where this is used?
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Will add Java, R, and Python translations tomorrow.
Added python
Added Java.
Added R.