# Ruby Challenge for Beginners #3 - Short Circuit

**URL:** <https://www.ruby-forum.com/t/ruby-challenge-for-beginners-3-short-circuit/178186>\
**Category:** Ruby\
**Created:** [October 30, 2009, 12:29pm UTC](https://www.ruby-forum.com/t/ruby-challenge-for-beginners-3-short-circuit/178186 "2009-10-30T12:29:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![indianguru](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3bc359/32.png) [@indianguru](https://www.ruby-forum.com/u/indianguru)\
**Post date:** [October 30, 2009, 12:29pm UTC](https://www.ruby-forum.com/t/ruby-challenge-for-beginners-3-short-circuit/178186/1 "2009-10-30T12:29:49Z")

</div>

Ruby beginners: The third installment of the Ruby P.ming Challenge  
for  
Newbies (Short Circuit) is now live. The problem has been set by Gautam  
Rege. Entry is free and registration is optional. You stand a chance to  
win  
a prize. Hurry. Only 20 days per challenge -

> **[Learn How to Blog and Build Websites for Profit!](https://heyblogging.com)**
>
> Ready to take your blogging skills to the next level? Learn how to build a website that generates income and sets you up for success.

Satish T.

> **[How to achieve proper employee training - Rubylearning.org](https://www.rubylearning.org/)**
>
> Here is an outline of various kinds of employee training that may be required in many different types of work environments and work sites.

---

<div class="post-metadata">

**Author:** ![indianguru](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3bc359/32.png) [@indianguru](https://www.ruby-forum.com/u/indianguru)\
**Post date:** [October 30, 2009, 4:31pm UTC](https://www.ruby-forum.com/t/ruby-challenge-for-beginners-3-short-circuit/178186/2 "2009-10-30T16:31:05Z")

</div>

On Oct 30, 6:04 am, Paul S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I think the problem is just looking for a simple shortest path  
> algorithm Dijkstra or something.

I think the challenge also suffers from a disconnect between the  
apparently intended goal and the stated goal. To solve the problem,  
you need to go through the effort of finding the shortest path; rather  
than return this path as the solution, you need to indicate which  
segments are _not_ part of the path.

---

<div class="post-metadata">

**Author:** ![indianguru](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3bc359/32.png) [@indianguru](https://www.ruby-forum.com/u/indianguru)\
**Post date:** [October 30, 2009, 12:46pm UTC](https://www.ruby-forum.com/t/ruby-challenge-for-beginners-3-short-circuit/178186/3 "2009-10-30T12:46:48Z")

</div>

On Fri, Oct 30, 2009 at 10:52 AM, Satish T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Ruby beginners: The third installment of the Ruby P.ming Challenge for  
> Newbies (Short Circuit) is now live. The problem has been set by Gautam  
> Rege. Entry is free and registration is optional. You stand a chance to win  
> a prize. Hurry. Only 20 days per challenge -  
> [Learn How to Blog and Build Websites for Profit!](http://rubylearning.com/blog/2009/10/30/rpcfn-short-circuit-3/)

I totally read that as “Entry fee is optional”

The problem statement might be flawed by trying to frame it in an  
electrical context. The author uses the phrase “Electricity always  
follows the path of least resistance” but I understood that current  
could flow down multiple routes in proportion inverse to the  
resistances, i.e. that if one path had a 10% higher resistance, it  
would receive 10% less current, not that all current would flow  
through the less resistive(?) path.

Feel free to correct my knowledge of physics and electrical engineering  
though.

I think the problem is just looking for a simple shortest path  
algorithm Dijkstra or something.

–  
Paul S.  
[http://www.nomadicfun.co.uk](http://www.nomadicfun.co.uk)

removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![indianguru](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3bc359/32.png) [@indianguru](https://www.ruby-forum.com/u/indianguru)\
**Post date:** [October 30, 2009, 5:06pm UTC](https://www.ruby-forum.com/t/ruby-challenge-for-beginners-3-short-circuit/178186/4 "2009-10-30T17:06:48Z")

</div>

On Fri, Oct 30, 2009 at 9:00 PM, Yossef M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I think the challenge also suffers from a disconnect between the  
> apparently intended goal and the stated goal. To solve the problem,  
> you need to go through the effort of finding the shortest path; rather  
> than return this path as the solution, you need to indicate which  
> segments are _not_ part of the path.

that’s actually a pretty good test of your datastructure.

martin
