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.
description is clear enough :)
You showed how to do it, why even bother about the description ? Description is fine.
me too :'(
hahahahahahahaha
Some reply about one part of your comment:
maximum element
. Hmmmm... Generally speaking, that is the maximum value/number in the array. For [1,200,3], it should be 200. For [4,500,6], it should be 500.biggest index
? Usually we call it by thelast element
.0 - a[i] doesn't alter the original array? No,
0 - (-3) = 3, 0 - (+3) = -3
;-)A bad news to me. I'm not good at the English grammar ;-)
If I am allowed to use Chinese, I think I will write a rigorous and detailed description ;-)
69 guys passed the tests and submitted their solutions. It seems that my descrption is not SOOO bad, right?
I made the following changes:
Hope this will be helpful ;-)
Thank you for your feedback.
lol! this solution made me laugh! :)
Empathetic??
First, this is VERY nice. Learn something new every day. :)
I don't feel like this is worded very well.
Is this supposed to be a coding puzzle, or a let's-see-if-we-can-correctly-interperate-the-author's-meaning puzzle?
It mentions an array
a
, but then in the description of the two steps to be done each itteration ofk
, it mentionsA
. Am I to assume thata
andA
are the same thing? Maybe that's what people are assuming, but I don't like to assume. Programming requires an attention to detail that appears to be missing here, making me assume thata
andA
reference the same array. But assumptions about the initial array parameter, aside...Then the instructions state "find M - maxumum element of the array" does that mean that I subtract the value of the maximum element of the array from some unknown value
M
? Or thatM
is litterally the last element in the array? A minus sign is used twice in the instructions, but it's apparently (maybe? I'm still not really sure) to be a hyphen in the first case and an actual subtraction operator in the second.The phrase "maximum element" seems really misleading. Does that mean the element in the array with the biggest index, or the element in the array with the biggest value (regardless of its index)? Trying to follow the two given examples, doesn't help. The biggest element (value-wise) is 0... well, it doesn't matter how many itterations you make applying the second operation to the array,
0 - a[i]
doesn't alter the original array at all. If you interperate "maxiumum element" to mean the last element in the array (the biggest or "maximum" one), you get the same0 - a[i]
since element 3 in the first example is 0.I even tried assuming (hate doing that...) that "maximum element" was talking about the values in the elements and not the indicies. Further, I tried assuming (again, grr...) that the author was from some planet where
-4 > 0 == true
(it's not... that's false just to be perfectly clear), and on a first itteration through the array initial array I get [0, -4, 3, -4].That's:
but this is already flawed to me, because I had to assume that -4 was somehow the "maxumum element".
Maybe I'm just stupid, or maybe this is less of an algorithmic challenge and more of a let's-see-if-we-can-correctly-interperate-the-instructions.
I would prefer algorithmic challenges with precise and clearly stated goals. An algorithmic challenge should never start by giving you the algorithm (i.e. find the max value then perform this operation).
This comment is hidden because it contains spoiler information about the solution
Well... I feel stupid now. ;)
I specifically tried to find a purely mathmatical solution. Not converting to a string, or an array and back.
Well, excpt when having to concatenate the squares together. :)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution