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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:16:30+00:00 2026-05-12T23:16:30+00:00

I have a grid like this: 1234567 1 ACBDBAB 2 ABDBABC 3 ABADBAB 4

  • 0

I have a grid like this:

  1234567
1 ACBDBAB
2 ABDBABC
3 ABADBAB
4 BABDAAB
5 BABCDBA
6 BDBABCB
7 ABBCBAB

Given a certain coordinate, for example (3:4), I’d like to find all the other
blocks with the same letter that have at least one common side with the original
block and one of those block (recursively). On my example, I’d like the following blocks:

  1234567
1 .......
2 .......
3 .......
4 ..B....
5 ..B....
6 ..B....
7 .BB....

My current idea is to check the original column up and down, by incrementing and
decrementing the row number until the letter is different, in my example this
would give me row numbers (4, 5, 6, 7). Then, I increment the
column number and check my previous row numbers, in my example, none of them are
of the original letter, so I start decrementing, I check 4, 5, 6 and 7 at column
2, and I see only 7 matches, so I continue to column 1 and I check row 7 and so
on.

  • 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-12T23:16:30+00:00Added an answer on May 12, 2026 at 11:16 pm

    I believe you are looking for the flood fill algorithm.

    Edit: I gave some thought to your proposed algorithm and realized why it wouldn’t work. The problem is that it only detects convex areas. Say you have a grid like this:

    BAB
    BBB
    BAB
    

    And you would like to replace all the B’s with C’s. If you started your algorithm from the B in the center of the grid, you’d get this:

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

Sidebar

Related Questions

I have grid something like this: Ext.define('Exp.view.dashboard.Tv', { extend: 'Ext.grid.Panel', initComponent: function() { this.columns
I have a function creating entries via grid() like this: (replace while-loop with function,
Let's say I have some grid that looks like this _ _ _ _
I have a Grid inside a Canvas defined like this: <Canvas x:Name=outerCanvas> <Grid Grid.Row=1
I have something like this in my xaml: <Grid> <Image Name=image Source=../../Images/DefaultImage.png HorizontalAlignment=Stretch VerticalAlignment=Stretch></Image>
I have a View that is basically setup like this: <Grid> <ViewBox> <Grid> <ItemsControl
i want to have a grid inside a div grid like this one: http://www.chinolatino.eu/
I have a grid something like this: A A A A A B C
I want to have a 3x3 grid layout structured like this: _ _ _
Hai presently i have grid like this. <Grid Name=tGrid1 Grid.Row=0 Background=Black > </Grid> <Grid

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.