Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
105 views

The code: #include <algorithm> #include <ranges> #include <vector> #include <tuple> #include <generator> #include <cstdio> #include <iostream> using ...
Ludovic Aubert's user avatar
2 votes
3 answers
141 views

The C++ reference has this example for printing the intersection of two sets (or sorted containers): #include <algorithm> #include <iostream> #include <iterator> #include <vector&...
Michaël's user avatar
  • 579
1 vote
1 answer
154 views

I have a table with columns name and full name, and am interested in knowing whether one is part of the other (but they are not equal). Example: name | full name | is_subset -------------...
Josh Friedlander's user avatar
0 votes
2 answers
115 views

I'm looking for an algorithm that returns (the length of) the intersection of two given N^4 lists / sets (more precisely in [|0;7|]^4). I'm not expecting an answer in a specific programming language (...
SerialCookie's user avatar
2 votes
0 answers
59 views

Basically a problem I've been thinking about for the past couple weeks... Initially thought of making each set in the list a node in a graph, and connecting nodes which do not have any common elements....
innie's user avatar
  • 21
1 vote
0 answers
214 views

Problem statement: Given a list L of sets, find every set X of elements such that: for all Y in L, the intersection of X and Y is non-empty the set X is minimal in the sense that no element in X ...
PPenguin's user avatar
  • 329
2 votes
3 answers
151 views

I'm trying to compute about 1 trillion different pairwise jaccard scores on a laptop. I'm also not very patient. Each set tends to contain about 200-800 unique, pseudorandom 32-bit hashes. I've ...
Some Java Programmer's user avatar
0 votes
1 answer
56 views

I am already using a Mongo db Aggregate Query to get a array of output. email will be the array of emails as input in the query. **aggregateQuery** = [ { '$match': { 'email': { ...
Vishal Gupta's user avatar
0 votes
1 answer
955 views

How do I return a column of all matching terms or substrings found within a string? I suspect there's a way to do it with pl.any_horizontal() as suggested in these comments but I can't quite piece it ...
Thomas's user avatar
  • 330
5 votes
2 answers
177 views

I want to calculate an overlap coefficient between sets. My data comes as a 2-column table, such as: df_example <- tibble::tribble(~my_group, ~cities, "foo", "...
Emman's user avatar
  • 4,313
0 votes
0 answers
105 views

what is a faster? sort two vectors and then do set_intersection... or auto intersection = std::make_shared<MediaItems>(); std::sort(m_currentSearchResults->begin(), m_currentSearchResults->...
chrisg's user avatar
  • 200
-4 votes
1 answer
344 views

I can't figure out how to take two BTreeSet objects and create a new, owned, BTreeSet from the intersection operation. Here is a Minimal Example: use std::collections::BTreeSet; fn test() -> ...
user2138149's user avatar
  • 18.7k
2 votes
1 answer
65 views

The following is an interesting algorithmic problem. Inputs: The set of elements S (say, non-negative integers). A mapping N that maps some elements from S to a subset S_k \subset S. (not all ...
artonson's user avatar
-5 votes
1 answer
836 views

I understand that one is bitwise operation while the other is not, but how does this bitwise property affect the results of given expression. As both should simply compare the elements in both sets ...
Divide's user avatar
  • 1
0 votes
2 answers
63 views

I have an array of sets [setA, setB, setC, setD, ..., setX] and I want to find a way to get the intersection of each combination (without repeat combos), so: AB = setA.intersect(setB) AC = setA....
Mailinnia's user avatar
1 vote
2 answers
61 views

Is there an algorithm similar to the bloom filter, that allows you to: Compactly represent two (large) sets independently of each other and probabilistically check for disjointness between them using ...
Andrew Wagner's user avatar
0 votes
1 answer
173 views

Why typeof body is resolve as Intersection Type SignRequest & {}. export interface HttpResponse<T> { statusCode: number; body: T | Error; } export interface HttpRequest<T> { ...
Cássio's user avatar
  • 159
1 vote
2 answers
59 views

The goal is to find the intersection of 2 arrays. I know you're supposed to use sets to get a faster runtime. However, in my notebook I was surprised to find that my runtime is not faster with the ...
Katsu's user avatar
  • 9,075
0 votes
3 answers
985 views

I have the following data: col1 [1,2,3] [1,2] [2,3] I want the following output ans [2] In other words, I want the intersection of arrays in all rows. Any pointers?
sha's user avatar
  • 642
0 votes
1 answer
176 views

I have the following dictionary di = { 'A': [['A1', 'A1a'], ['A1', 'A1a'], ['A1', 'A1a'], ['A1', 'A1a'], ['A1', 'A1a']], 'B': [['A1', 'BT', 'B2', 'B2a', 'B2a1a']], 'G': [['A1', 'BT', '...
Ctat41's user avatar
  • 69
0 votes
2 answers
102 views

#include <string> #include <vector> #include <algorithm> using namespace std; struct Item1{int id; int data;}; vector<Item1> v1 = {{.id=1,.data=42},{.id=2,.data=69}}; struct ...
Ludovic Aubert's user avatar
0 votes
3 answers
227 views

I have an arbitrary list of lists, for example x = [ [5, 1, 2, 3, 4], [5, 6, 7, 8, 9], [5, 10, 11, 12] ] There is only one element which is a member of all three lists in ...
rorance_'s user avatar
  • 379
0 votes
2 answers
195 views

Please, could anyone help with error 91, I can't find a solution. Firstly the related code part: ....... Application.EnableEvents = False PrUpr.UJournal 'Protection code for sheet is located in ...
Arno Z's user avatar
  • 3
2 votes
3 answers
766 views

Using PowerShell, I have 14 arrays of strings. Some of the arrays are empty. How would I get the intersection (all elements that exist in all of the arrays) of these arrays (excluding the arrays that ...
MaxRax's user avatar
  • 23
6 votes
2 answers
285 views

The current release of the package gmp does not support set operations such as intersect, setdiff , etc. I'm doing some work with number sequences (see OEIS for examples) and need to handle large ...
Carl Witthoft's user avatar
0 votes
1 answer
70 views

I wish to do what is described in this previous question but instead of lists a,b,c I have i number of lists (that is set based on user input): Find common values in multiple lists How can I change ...
John Warts's user avatar
0 votes
1 answer
394 views

Product table contains tags columns: create table product( product char(20) primary key, tag1 char(100), tag2 char(100) ) tag columns contain tags separated by semicolon like AB;AC;AD RXX;AC;...
Andrus's user avatar
  • 28.2k
2 votes
0 answers
78 views

I want to know the database or platform that will be most suitable for performing heavy set operations. Especially INTERSECTION, DIFFERENCE over millions of values in sets.
Ravi's user avatar
  • 2,291
1 vote
0 answers
221 views

I have a list of sets a and another list of sets b. I want to intersect each set in a against every set in b, and if the result is not empty, then report the index positions of the matched sets, and ...
user2474226's user avatar
  • 1,512
1 vote
1 answer
90 views

Using the following containers: std::vector<std::pair<std::string, int>> keyVals = { {"A", 1}, {"B", 2}, {"C", 3} }; std::vector<std::string> keys ...
johnco3's user avatar
  • 2,661
2 votes
1 answer
3k views

I have a table which has a JSON type field where I save a number array like [1, 2, 3, 4]. I want to select records in which its array set contains at least one element of another array I have in a php ...
AlexSp3's user avatar
  • 2,273
1 vote
3 answers
348 views

Note : almost duplicate of Numpy vectorization: Find intersection between list and list of lists Differences : I am focused on efficiently when the lists are large I'm searching for the largest ...
Laurent Claessens's user avatar
0 votes
1 answer
80 views

Consider a mongo db where each document corresponds to a spatial trajectory. That is, there is a field that contains an array for each document. Each array is a sequence of latitude/longitude pairs ...
user404332's user avatar
0 votes
2 answers
98 views

This is the minimum code to obtain arrays intersection without any repetition in the final array. Can it be improved ? I think it can't because it uses the minimum number of iteration thanks to the ...
Dresult's user avatar
  • 313
1 vote
2 answers
2k views

I'm trying to compare 2 collections, and put all values present in both into another collection. So given these collections: $text1 = collect('burger', 'cheese', 'bread', 'ham'); $text2 = collect('...
Dave Hulst's user avatar
0 votes
2 answers
960 views

How can I finish my code below? Where should I add isEmpty? And how to just print "The Intersected Elements of Set A and B are:" once only? #include <iostream> using namespace std; ...
Crystal's user avatar
0 votes
1 answer
106 views

I was trying to solve below problem: Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays ...
user avatar
0 votes
1 answer
479 views

I have a data frame with one column. Each value in this column is a list. For example, A 0 [1, 3, 4] 1 [43, 1, 42] 2 [50, 3] I want to perform the set intersection operation between each ...
user8561039's user avatar
2 votes
0 answers
740 views

I currently need to intersect two sorted vectors. Here are my implementations: #include <immintrin.h> #include <stdint.h> #include <algorithm> #include <bit> #include <...
Kroma's user avatar
  • 1,151
1 vote
1 answer
362 views

My core data model has an entity with an attribute setOfStrings of type Transformable. The corresponding class has a property @NSManaged var setOfStrings: Set<String>?. I want to fetch objects ...
Reinhard Männer's user avatar
2 votes
1 answer
2k views

I am currently trying to intersect a list of IDs with a child property of my Database Entity. The intent of doing so is to find all "Form" records that that have all of the list Ids matching ...
Bitz's user avatar
  • 1,148
0 votes
1 answer
238 views

I have a task in which i have to find the "degree of intersection" in various dataframes containing the Top 50 Spotify Charts of multiples countries. In order to do this, im intersecting ...
RODRIGO HERNAN BRITO RUIZ's user avatar
-2 votes
2 answers
465 views

If I had, say separate 3 nested ArrayLists of Strings, i.e., ArrayList<ArrayList<String>>: What is the most efficient way of finding their intersection (common elements)? Are there other ...
user1684938's user avatar
0 votes
1 answer
81 views

I wrote a program to compare two text files containing all of the words in the dictionary (one forwards and one backwards). The idea is that when the text file containing all of the backwards words is ...
maria9876's user avatar
0 votes
1 answer
311 views

Given an ArrayList of ArrayLists with size larger than 3 ArrayList<ArrayList<Integer>> lists = new ArrayLists<ArrayList<Integer>>(); I want to take 3 unique sub-lists, find ...
hexaquark's user avatar
  • 1,011
0 votes
0 answers
154 views

I am a C++ novice, so bear with me if my formatting isn't perfect. I am writing a program called palindrome's cousin that finds all the words in the dictionary that spell another word backwards (i.e. ...
maria9876's user avatar
0 votes
1 answer
39 views

Am working on a JavaScript simple game (game like one google chrome shows on no network presence). I would like to dictate that the incoming span is in contact with the first span. (trouble ...
James in code's user avatar
0 votes
1 answer
183 views

I'm trying to find the intersection of 2 multisets of objects using std::set_intersection function. #include <algorithm> #include <set> struct Interval { double bottom; double top; }; ...
Jamāl's user avatar
  • 121
2 votes
3 answers
930 views

Lets assume, my data is like group_id col1 1 1 A,B 2 1 B,C 3 2 A,C 4 2 B,D 5 3 A,D 6 3 A,B,C,D I would like to summarise/mutate col1 ...
AnilGoyal's user avatar
  • 26.3k
1 vote
1 answer
425 views

Given the following TypeScript code: interface A { /* ... */ } interface B extends A { /* ... */ } type Mystery = A & B; Objects of the Mystery type should have all the properties of A and all ...
nullromo's user avatar
  • 2,737

1
2 3 4 5 6