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.
Not allowed to use #rotate or #reverse for my upcoming interview assessment, so I'm doing all method manually.
Okay! So would some code that would catch the
ValueError
be (in Ruby):raise ValueError if int > arr.size
In my coding program there's a huge emphasis on understanding the whole problem before attemping it, instead of hack/slash coding. My problem isn't super complex, it's closer to 7 kyu than 6, really. The more problems cause people to go back and re-read after they've completed a solution to implement some fix, the more that people will slow down and really think about each step of the problem before tearing into it.
Okay, I'll republish the kata once it's all corrected and hope for the best. :)
Okay! That's clear on what I should ask from them, but what value is being returned when they raise an Exception?
I meant that just that for people at or near my level of problem solving ability (6 to 5 kyu), I think we may rush into solving a problem if we can see a probable solution right off the bat. Adding another layer of complexity, like returning the middle value of the new array, may add just a little more challenge and cause us to slow down and think about the problem harder. In hindsight, the different return value of this one seems a little contrived.
I'm making a random test case method now, but since this is already retired can it be re-published with all the corrections I'm making?
You make some great points, especially about if the array is holding the string
'Integer is too large'
.Thank you for the feedback! I'm editing now.
Since I'm new to this, what would be considered a good practice exception? Just returning the middle integer as it is, no reversing, if the integer is larger than the size of array?
I moreso put the requirement to return the middle value from the array just as a reading comprehension check, to make sure that people read the problem well in creating pseudocode.
Thank you for pointing this out. Currently looking up how to make random tests. If you have any guides to pass along, I'd love any help.
Thank you for the feedback. I think I'll remove that part from the problem. No need to restrain people!
My first kata on Ruby: https://www.codewars.com/kata/5cc3514544a32d002b3c0316
Feedback is appreciated.
Thank you so much, Chrono! I really appreciate the help. :) Have a great night!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution