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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:52:40+00:00 2026-06-13T20:52:40+00:00

So I have this: a = [[4, 8], [5, 6, 9, 10], [13]] I

  • 0

So I have this:

a = [[4, 8], [5, 6, 9, 10], [13]]

I want to get the difference (subtraction) between:

4 - 5 = a[0][0] - a[1][0]

4 - 6 = a[0][0] - a[1][1]

4 - 9 = a[0][0] - a[1][2]

4 - 10 = a[0][0] - a[1][3]

and then move on to the 8:

8 - 5 = a[0][1] - a[1][0]

8 - 6 = a[0][1] - a[1][1]

...

And so on for all the sub-lists

Any ideas?

EDIT: The other comparisons would look like this:

5 - 13 = a[1][0] - a[2][0]

6 - 13 = a[1][1] - a[2][0]

9 - 13 = a[1][2] - a[2][0]

10 - 13 = a[1][3] - a[2][0]

And because this is the second to last list, then it stops.

I’m trying to implement the Quine-McCluskey method to minimize logic expressions.

  • 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-06-13T20:52:41+00:00Added an answer on June 13, 2026 at 8:52 pm

    Assuming that after finishing a[0][1] - a[1][x] you want to continue with a[0][0] - a[2][0], and then eventually also do a[1][0] - a[2][0] etc.:

    result = []
    for i, sub_x in enumerate(a[:-1]):
        for sub_y in a[i+1:]:
            for x in sub_x:
                result.append([x - y for y in sub_y])
    
    >>> result
    [[-1, -2, -5, -6], [3, 2, -1, -2], [-9], [-5], [-8], [-7], [-4], [-3]]
    

    As a list comprehension:

    [[x - y for y in sub_y]
         for i, sub_x in enumerate(a[:-1]) for sub_y in a[i+1:] for x in sub_x]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get the difference between two images I use this source code:
So I have Image like this (source: de-viz.ru ) I want to get something
So I have Image like this (source: de-viz.ru ) I want to get something
I have subclassed a UITableViewCell and within this class I want to get it's
I have trouble doing this... You may want to get the same result as
I want to get this straight. I know what DLL's are. I have done
I have some date and I want to get last x day before this
I have two issues in this google chart. I want to either get rid
I have a variable which I get from database I want to output this
I can't get this to work.. I have an String which I want to

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.