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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:47:55+00:00 2026-05-26T02:47:55+00:00

When given a square matrix, what would be the best way to find all

  • 0

When given a square matrix, what would be the best way to find all of the possible arrays within it without using more than one element from any row/column in each array?

For example, in a matrix like so:

0 2 3 
1 2 3 
1 2 0

It would then go through it like this:
enter image description here

And then it would output the following list of arrays:

123
123
023
123
120
020
  • 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-26T02:47:55+00:00Added an answer on May 26, 2026 at 2:47 am

    You can directly map each such array to a permutation of the digits (0 .. size-1). To show you how this works, the permutation (2,1,0) maps to the 3 coordinates (2,0), (1,1), (0,2). The 6 examples you gave are

    (2,1,0)  (1,2,0)  (0,2,1)
    
    (2,0,1)  (1,0,2)  (0,1,2)
    

    To explain the mapping, lets take the first permutation (2,1,0) --> (2,0), (1,1), (0,2). Then, the values you want to use are array[2][0], array[1][1], array[0][2]

    So now the question is how to generate each permutation. There are a few algorithms, one of which is implemented in java here: http://www.merriampark.com/perm.htm

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

Sidebar

Related Questions

Is there an algorithm to find the square root of a given number using
I have some simple code that represents a graph using a square boolean matrix
Given a matrix A (not neccessarily square) with independent columns, I was able to
Given a square matrix, where each cell is black or white. Design an algorithm
Say I have a square from (0,0) to (z,z). Given a triangle within this
Given: square matrix, and list which represents the index of rows to be removed,
I'm trying to take the square root of a matrix. That is find the
I'm using CUBLAS (Cuda Blas libraries) for matrix operations. Is possible to use CUBLAS
Given a square image, how can you get the iPhone icon effect using ImageMagick's
I'm interested in using numpy to compute all of the minors of a given

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.