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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:10:56+00:00 2026-06-14T00:10:56+00:00

So, to explain the mouthful that is the question… I’m trying to use filter,

  • 0

So, to explain the mouthful that is the question…

I’m trying to use filter, and not getting anywhere. So here’s the behaviour I want. Given a list of lists (of Integers) ie

[[1,2,3],[23456,4,3,2],[1,3,4,5,6],[3,2,1],[4,2,1],[5,6,7],[1,2,5]]

I want to take another list ie [1,2] and take all the lists that contain both those elements. (It doesn’t matter if any of the others are preserved at this moment in time, though that might be needed later). So in this example my output would be something like

[[1,2],[2,1],[2,1],[1,2]]

or preferably

[[1,2,3],[3,2,1],[4,2,1],[1,2,5]]
  • 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-14T00:10:58+00:00Added an answer on June 14, 2026 at 12:10 am

    So you want to keep a list candidate if all elements of the list criterion are also elements of candidate. Thus your filter condition is

    condition candidate = all (`elem` candidate) criterion
    

    which, using flip we can write as

    condition candidate = flip all criterion (flip elem candidate)
    

    thus giving

    filter (flip all criterion . flip elem)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To explain my question I have created this http://jsfiddle.net/Jams/XNVB2/ here I want when div1
To explain my question: Class : Toy Trait1: Speak like Male Trait2: Speak like
Please explain what this task is about? Create a generic linked list class that
Explain SQL (in phpmyadmin) of a query that is taking more than 5 seconds
Explain this interview question to me: Q: If the variable $a is equal to
Explain the use of ISynchronizeInvoke in cross thread invocation in .NET?
Please explain me why that code: class kategoria { public $IdKat; public $NazwaKat; public
Please explain using plain english why we need and why we use Interface in
Please explain me why if I use the raw type A in the method
To explain what I'm trying to do: I have a navigationController with a list

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.