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 4617054
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:04:14+00:00 2026-05-22T02:04:14+00:00

so, I have a ragged array (called names) of length 200. each pointer in

  • 0

so, I have a ragged array (called names) of length 200. each pointer in the array points to a string that is no longer than 50 characters and has no white spaces. I also have a string given through user-input called inname, with length 50, inname will be one of the strings stored in names. I need to find a way to go through the strings in my ragged array and find the string with the largest substring overlap with inname, excluding inname itself as that will be in the file. If no string has an overlap then we print out “no recommendation”.
I’ve been melting trying to puzzle this out for many hours now, helps? O:) SO basically, the program finds the name in the array with the largest substring overlap with inname.
will edit to provide additional info if you need it

  • 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. Editorial Team
    Editorial Team
    2026-05-22T02:04:15+00:00Added an answer on May 22, 2026 at 2:04 am

    This won’t lead you to the most efficient way to find overlap (dynamic programming is one way–there are other crazy methods like suffix trees), but it should get you started:

    First, think about how you would find the length of the overlap with the beginning of both strings aligned. For instance, find the longest overlap between these two:

    programming
    ungrammatical
    

    In this case, only a single m overlaps–a length of 1.

    Then think about how you would “shift” the strings and look for the overlap when they are aligned differently. (Don’t actually change the strings: just change how you loop through them to compare them.) What is the overlap between these two?

    programming
     ungrammatical
    

    Think about how to look at all possible alignments. If you keep track of the longest one you find, you have the longest alignment between two particular strings.

    After that, move on to checking all the different strings. Keep track of the one with the best match, and again, once you have looked at all of them, you have your answer.

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

Sidebar

Related Questions

I have an array created in MATLAB that contains a number of cell type
Have you determined a maximum number of characters allowed in FCKEditor ? I seem
I have set up each document with a date field. (keyword) Values stored in
I have about two macros (and climbing) in my codebase that look like this:
Have a photography site that I want to prevent image copying from. How can
I have a website where each page contains a few frames. I recently started
I have written an app that takes an uncompressed .wav file and encodes into
Have an app that can use tts to read text messages. It can also
I have arrays of dates in Y-m-d format that may be any combination of
I have to build an SSIS package for work that takes the contents of

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.