6 kyu
Magnitude
9 of 347g964
Loading description...
Fundamentals
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.
Nice kata. Not actually hard, but very interesting:)
Ouch that was fun, but I'd be totally lost if I couldn't do
return inputVar
or the prints to console lol. I badly overestimate my algorithm skills.I think there's still an issue in Python, how should we handle that input: ['polar', 39, 39, 36, 26, 18, 15, 29, 27, 33, 39, 39, 18, 16, 47, 24, 47, 27] ? Texts expect correct, however it contains an odd number of integers, and description does not say how we are supposed to form complex numbers in those conditions (and I can't figure out of the expected result is calculated, through my code gives correct answers when number of integers is even). Edit: Well, actually I got it: one must add to the sum the square of the remaining integer. However for me this is out of the description.
Until now nobody complained:-) If there is an odd numbers of integers, consider that the last one
z
isz = a = a+O*i
orz = r = (r, 0) = r(cos0+isin0)
, no?I think this should be at least stated in the description (or, at least, there should be an example of this type in the basic tests; it seems those minoritary unexpected cases are juste like traps added to make codes fail artificially). Missing data is not obviously 0, it is missing data. Maybe I'm psychorigid, do what you think is right :)
seems to contradict
which has three complex numbers which is not even
but it probably wants to say that there will always an odd number of elements, so there is either a contradiction or a typo'd and false promise
there's also
'polara
in there, so there are three tags in totalaside from that I don't like the language specific bits (very noisy) but whatever.
edit: it's also leaking what is presumably an idiom in lisp, into other languages. too late to do anything about that, obviously.
I simplified the description and changed the Python random tests so the input length is always odd (tag included). If you agree (no, I don't think you are psychorigid:-) I will change the tests in other languages.
It's ok for me, thanks ;)
I've forked the Rust translation in order to update it to Rust 1.49 and updated
rand::Rng::gen_range
to its new signature that takes astd::ops::Range
.Approved, you are doing a great job!
Thanks! :-)
Shouldn't the length of the array always be odd? In my code, if I take out the snippet that says: if len(arr) % 2 != 1: return (False,-1,1)
I get a list index out of range error. I am also failing all the test cases that do not meet this criteria for some reason.
Python? Fixed. I tried your solution (which is rather long:-), submitted it by error (!) and it passes.
Hey there, I am not quite understanding how the 52 is being calculated. Can someone explain that to me? sqr_modulus(['cart', 3, 4]) -> (True , 25, 52)
52
is the biggest number you can get with the digits2
and5
of25
.@g964 Thanks a lot!
Heterogeneous lists of objects in a statically typed language (
List<object>
), input checking, valid input still is a heterogeneous list, randomly mixed tasks (complex numbers and sorting digits, rly?), returning a tuple as aList
, dependent values in the result (False
=>-1, 1
), magic number (-1
), probably done previously in other katas. The only thing left is to add "warning: don't do this in production" to the description...I wanted a "potpourri"... It seems that I have it:-)
Hi,
What's the point of the third output? Maybe you could remove that part? (I don't see the point of it, in the current context)
See above:-)
well, maybe that's not a good idea, don't you think? :/
My aim in this kata was to show in two small exercises how to:
These two tasks were not enough hence the last: manipulate digits of an integer. Of course it's not for super power users:-)
Interesting like all your katas that I have tried, g964. In my opinion (for what it is worth), it is a good programming exercise. Aesthetically, it is regrettable that the "third part" - greatest number - has little connection to complex numbers, but I can see why it is there. Would it be appropriate to hint, in the description, that Racket 'match' might be useful?
Thanks for your dedication to Racket!