Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 163649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:36:15+00:00 2026-05-11T11:36:15+00:00

I have this massive array of ints from 0-4 in this triangle. I am

  • 0

I have this massive array of ints from 0-4 in this triangle. I am trying to learn dynamic programming with Ruby and would like some assistance in calculating the number of paths in the triangle that meet three criterion:

  1. You must start at one of the zero points in the row with 70 elements.
  2. Your path can be directly above you one row (if there is a number directly above) or one row up heading diagonal to the left. One of these options is always available
  3. The sum of the path you take to get to the zero on the first row must add up to 140.

Example, start at the second zero in the bottom row. You can move directly up to the one or diagonal left to the 4. In either case, the number you arrive at must be added to the running count of all the numbers you have visited. From the 1 you can travel to a 2 (running sum = 3) directly above or to the 0 (running sum = 1) diagonal to the left.

0   41   302   2413   13024   024130   4130241   30241302   241302413   1302413024   02413024130   413024130241   3024130241302   24130241302413   130241302413024   0241302413024130   41302413024130241   302413024130241302   2413024130241302413   13024130241302413024   024130241302413024130   4130241302413024130241   30241302413024130241302   241302413024130241302413   1302413024130241302413024   02413024130241302413024130   413024130241302413024130241   3024130241302413024130241302   24130241302413024130241302413   130241302413024130241302413024   0241302413024130241302413024130   41302413024130241302413024130241   302413024130241302413024130241302   2413024130241302413024130241302413   13024130241302413024130241302413024   024130241302413024130241302413024130   4130241302413024130241302413024130241   30241302413024130241302413024130241302   241302413024130241302413024130241302413   1302413024130241302413024130241302413024   02413024130241302413024130241302413024130   413024130241302413024130241302413024130241   3024130241302413024130241302413024130241302   24130241302413024130241302413024130241302413   130241302413024130241302413024130241302413024   0241302413024130241302413024130241302413024130   41302413024130241302413024130241302413024130241   302413024130241302413024130241302413024130241302   2413024130241302413024130241302413024130241302413   13024130241302413024130241302413024130241302413024   024130241302413024130241302413024130241302413024130   4130241302413024130241302413024130241302413024130241   30241302413024130241302413024130241302413024130241302   241302413024130241302413024130241302413024130241302413   1302413024130241302413024130241302413024130241302413024   02413024130241302413024130241302413024130241302413024130   413024130241302413024130241302413024130241302413024130241   3024130241302413024130241302413024130241302413024130241302   24130241302413024130241302413024130241302413024130241302413   130241302413024130241302413024130241302413024130241302413024   0241302413024130241302413024130241302413024130241302413024130   41302413024130241302413024130241302413024130241302413024130241   302413024130241302413024130241302413024130241302413024130241302   2413024130241302413024130241302413024130241302413024130241302413   13024130241302413024130241302413024130241302413024130241302413024   024130241302413024130241302413024130241302413024130241302413024130   4130241302413024130241302413024130241302413024130241302413024130241   30241302413024130241302413024130241302413024130241302413024130241302   241302413024130241302413024130241302413024130241302413024130241302413   1302413024130241302413024130241302413024130241302413024130241302413024   02413024130241302413024130241302413024130241302413024130241302413024130   
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:36:16+00:00Added an answer on May 11, 2026 at 11:36 am

    But I like homework 🙂

    I find it easier to reason about the ‘paths’ problem when starting from the top, and following the rules the other way around.

    This means:

    • a partial path can be the top zero, or an extended partial path
    • the extensions of a partial path Pr,c are, unless r is the last row, in which they’re complete, the union of
      • the extensions of Pr,c + P(r+1),c
      • the extensions of Pr,c + P(r+1),c+1

    The ‘sum’ rule just selects certain of all complete paths.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 122k
  • Answers 122k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It works, but you have to do a lot more… May 12, 2026 at 12:36 am
  • Editorial Team
    Editorial Team added an answer You may want to check out Igor Pro. It's quite… May 12, 2026 at 12:36 am
  • Editorial Team
    Editorial Team added an answer This is due to how these pages are created -… May 12, 2026 at 12:36 am

Related Questions

I would like to get a byte[] from a float[] as quickly as possible,
I am working on a program which manipulates images of different sizes. Many of
On SQL Server 2005, I have a complex multi-level allocation process which looks like
I have an importer process which is running as a windows service (debug mode

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.