Hackerrank Day 1: Quartiles

screen-shot-2016-12-29-at-4-46-15-pm

My Solution in Ruby:

It was helpful to sketch this out on paper first.  Lots of math to confuse myself with.

I don’t think this is the most optimized solution, but it’s pretty easy to follow, at least IMO.

Screen Shot 2016-12-29 at 4.49.35 PM.png

Note to self:  

array.delete_at(n)  only returns the deleted value, NOT the array without the deleted value.

Advertisements
Hackerrank Day 1: Quartiles

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s