Skip to main content
Filter by
Sorted by
Tagged with
3 votes
2 answers
725 views

Using PHP 8.4, given the following functions: function test_array_diff($all, $filtered) { return array_diff($all, $filtered); } function test_array_udiff($all, $filtered) { return array_udiff(...
Damien Garrido's user avatar
1 vote
0 answers
69 views

I'm trying to find a difference of sets (I use vectors but idea is the same: arr1 \ arr2) using inline assembly in VS. But I can't get rid of the following error: "An exception was thrown: read ...
Ruslan Vaitukevich's user avatar
0 votes
1 answer
125 views

The difference is in 4th line for both code(given below). In 1st one, I declared some variable and then initialized the array. In 2nd one, I initialized the array first and then declared the variables....
Rahul Das's user avatar
1 vote
1 answer
90 views

I'm trying to use a metpy script to make Skew-T diagram. My source data uses the Dew Point Depression (dewpt) parameter and the original script uses the Dew Point (Td) parameter. Knowing the ...
Marina's user avatar
  • 13
-4 votes
1 answer
114 views

I have a one-dimensional array of values in one array and I need to filter it by a particular property/column in an array of objects. My input arrays are populated by the following code: $array_one = ...
Behzad's user avatar
  • 85
1 vote
1 answer
632 views

Hi all I need to return the minimum possible absolute difference. My code is below, function minAbsDiff(nums) { const n = nums.length; const sum = nums.reduce((acc, val) => acc + val); const ...
sabari logesh's user avatar
0 votes
1 answer
307 views

Trying to compare 2 arrays that contains json objects in painless (elastic) A: [{"key":"a1"},{"key":"a2"},{"key":"a3"},{"key":&...
Space_walker's user avatar
2 votes
1 answer
354 views

I want to get the difference between the two arrays in my controller. If I use array_diff() function, it gives me an error array_diff(): Argument #1 ($array) must be of type array, Illuminate\Support\...
iAmBorgy's user avatar
  • 113
0 votes
1 answer
77 views

I have a list of items in array, and the number of items are many(more than 100s). The items in array are updated by user interactions(add, remove, update). What I want to do is to find incremental ...
allenhwkim's user avatar
  • 27.8k
3 votes
2 answers
139 views

I'm struggling on how to generate a "Differences" Ordered-Dictionary containing the Different and also New values appearing on a "Modified" Ordered-Dictionary after comparing with ...
Cristobal Vila's user avatar
0 votes
2 answers
62 views

I have two strings and I need to compare the words of the each sentence. The strings are this two: $correctSentence = "The year stations are summer, winter, spring and fall."; $textSentence ...
Jefferson Farid's user avatar
0 votes
1 answer
154 views

I'm new to C++ programming. I want to make a code that shows elements which two char vectors have and do not have in common. I started by creating two string by cin and then pass them to vectors. But ...
Franco Lopez's user avatar
1 vote
1 answer
52 views

I need to test an array to make sure it has all elements I am expecing. The twist here is that we are talking about multidimensional arrays. Here is an example: $required_data = [ 'firstname', ...
user1274113's user avatar
1 vote
3 answers
2k views

Compare two array of objects to find distinct values by all key values So I found a lot of documentation like Get unique values by comparing old and new array objects but my case is a bit more complex....
leonleprofessionnel's user avatar
0 votes
1 answer
251 views

If I have two (or more) lists, I would like to get all parts of the "venn diagram" made by those lists: i.e. elements unique to A, elements unique to B, and the intersection of A and B. The &...
Fly's user avatar
  • 868
0 votes
0 answers
21 views

In a question form, there is a checkbox for the options of the question. I use the checkboxes as the question has more than one correct answer. When POSTing this form information. (via JSON) Sample: {&...
Emre6's user avatar
  • 105
0 votes
2 answers
176 views

I have this class : class MyObject{ var $title = null; var $description = null; var $items = []; var $metas = []; var $image = null; var $country = 'Belgium'; } And this data : $data = ...
gordie's user avatar
  • 2,025
0 votes
1 answer
250 views

Hey i have the following code: <html> <table> <table> <thead align="left" style="display: table-header-group"> <tr> <th>Projektnummer ...
user avatar
0 votes
3 answers
309 views

Arrays - const source = [1, 1, 1, 3, 4]; const target = [1, 2, 4, 5, 6]; Empty arrays - const matches1 = []; const matches2 = []; const unmatches1 = []; Loop - for (const line of source) { const ...
heyheyhey2's user avatar
0 votes
1 answer
150 views

Is there a way to compare an incomplete array to the source of truth array & return the missing elements? The array consists of objects & some of the objects have an array of objects. let ...
Brad Legassick's user avatar
0 votes
2 answers
56 views

I have the following script where I'm checking/matching items between two array. If 2nd array contains different item then return false; $requiredString = [ "string1", "string2&...
Pawan Rai's user avatar
  • 711
0 votes
1 answer
97 views

I'm working with two plots of density as a function of distance on IDL. What I'd like to do with them is convert them into plots of distance as a function of density and plot their difference, in ...
Francesco Azzollini's user avatar
0 votes
2 answers
422 views

I have the table below. ╔════════════════════╦════════════════════╦═════════════╗ ║id ║arr1 ║arr2 ║ ╠════════════════════╬════════════════════╬═════════════╣ ...
hsnsd's user avatar
  • 1,823
1 vote
1 answer
94 views

I have two arrays that represent a fifo-like state, an old state and a new state. I need a function that finds the newly added items by comparing the new array with the old one. Below 3 examples of ...
Jonathan de Geus's user avatar
0 votes
1 answer
21 views

I need to calculate the "Value Gap" between the reported volume of various commodities. For example (table below), USA reports that they exported 4 apples to China. China reported they they ...
CLancaster's user avatar
0 votes
2 answers
58 views

I have an issue, I have this array $items= array('ABC','DEF',GHI'); and have another two arrays $array1 = array('ABC','DEF',GHI'); $array2 = array('DEF'); $array1 should return TRUE because all ...
mxr10's user avatar
  • 11
0 votes
1 answer
433 views

I have to arrays and I have to find difference values from it. Here is my Laravel Controller code $product_list = Operation::where('kvit_id', $kvit->id)->pluck('product_id')->toArray(); $...
Hayrulla Melibayev's user avatar
2 votes
3 answers
78 views

I have a script with 10 sets of numeric values. Every set has six different numeric values from 1 to 99. <?php $set1 = ['23', '11', '52', '33', '1', '4']; $set2 = ['66', '70', '55', '8', '22', '1'...
Francesco's user avatar
0 votes
1 answer
130 views

I am building a custom string class. However, the user inputs give different output from the assigned-value one. For example: With the assigned values: #include"custom_string.h" int ...
Eureka's user avatar
  • 85
2 votes
2 answers
2k views

I've got 2 long numpy arrays, both having 508 elements. I would like to get the indices of where they differ. Most of the solutions I've seen determining difference here sort the arrays which is not ...
Alex K's user avatar
  • 159
2 votes
0 answers
66 views

I'm working on a particular problem which I managed to solve in a very inefficient way and I would like to see if there a more efficient way to do it. I have a Dataframe that has its first column ...
Gus's user avatar
  • 193
0 votes
1 answer
173 views

Given 2 arrays a and b find the max value of b[i] + b[j] + b[k] (i !=j != k) , where the following condition is satisfied a[i] > a[j] > a[k] I can calculate it by using 3 loops. I have been ...
Ann's user avatar
  • 53
0 votes
1 answer
82 views

I'm trying to compare 2 arrays and what I want to know from them is if they match and if they don't match. So what I mean by that is if my old values matches the new values completely, for example all ...
Aurilie's user avatar
  • 219
0 votes
1 answer
330 views

I am trying to get the difference between two arrays in excel VBA. I found a solution to what I am trying to achieve here: Solution But it seems to work only with 1D arrays. Here you have a sample of ...
Pimo's user avatar
  • 141
0 votes
2 answers
226 views

I have two rows, A (assumed to not have any nulls) and B (can contain blank cells) in Excel. A and B are both the same length. What is the correct Excel formula to compute the maximum positive ...
Wilson's user avatar
  • 255
1 vote
1 answer
263 views

Given two arrays of RandomModelObject that conform to Codable, Equatable and Hashable I want to calculate a diff between them and animate content changes in a UICollectionView. Having to support iOS ...
mgapinski's user avatar
  • 483
0 votes
1 answer
250 views

I'm working on some HackerRank Problem Solving challenges. The language I am using right now is Swift. The objective is to calculate the diagonal difference of a square array with n columns and rows. ...
Ishaan Masil's user avatar
2 votes
5 answers
131 views

I want to find difference between two arrays. I tried below code from one of the solution given on SF community, but not working from me. My below code is not working if there is number repeated EVEN ...
OTP Generator's user avatar
0 votes
1 answer
41 views

How do I get differences between 2 arrays and form differences in new array? arr1 = [1,2,3,4,5]; arr2 = [1,2,3,4]; newArr = [5]; Answer must be the same when arr1 and arr2 switch places.
Consxious's user avatar
1 vote
1 answer
49 views

I continuously need to evaluate sets of raw data (1-1000 rows, 3 columns) in 5-15 sheets every time. For two of the columns I have written a code that helps me take the average of every 5th value (...
MatRyt's user avatar
  • 13
0 votes
1 answer
93 views

I am comparing 2 arrays but after applying array_diff it returns the result in the object form. Have a look at the below code and result <?php $schedule = ['Monday'=>['12:00','01:20'],'...
Ryuk's user avatar
  • 382
0 votes
3 answers
79 views

I have 2 arrays and need to find the unique values in the second array that are not in the first array and output those to a third array. Array 1 $array1 = array( 0 => 'value12', 1 => '...
Mike's user avatar
  • 607
0 votes
1 answer
54 views

I have a directory which contains .txt files. In each .txt files are lines, under each other. the 2nd line is the category line. A txt file looks like this: id-12345678 // id line sport // category ...
john's user avatar
  • 1,273
0 votes
0 answers
241 views

In some .txt files i have a line with some "categories". A line (categories line) in a txt file looks like this: athletics //category line or swim //category line or offside //category line offside,...
john's user avatar
  • 1,273
2 votes
3 answers
299 views

I have a data.table, dt: dt Id v1 v2 v3 x1 x2 x3 1 7 1 3 5 6 8 2 1 3 5 6 8 5 3 3 5 6 8 5 1 v1, v2, v3 and x1, x2, x3 are numeric variables I want to subtract the 'x' columns ...
Emma's user avatar
  • 143
0 votes
2 answers
163 views

I have a dataset that is comprised of a date and two other columns that are in array format. I am trying to find all the values in array_1 that are not in array_2. Date | Array_1 | Array_2 -------...
lucas winter's user avatar
0 votes
1 answer
381 views

Hey Stackoverflow Community, I got a little problem where I´m stuck at the moment.. I have to write a code, that have to find the biggest " temperature " difference between given days. These are my ...
Marius1773's user avatar
2 votes
1 answer
224 views

I am trying to run array_diff on 2 arrays. sub array_diff(\@\@) { my %e = map { $_ => undef } @{$_[1]}; return @{[ ( grep { (exists $e{$_}) ? ( delete $e{$_} ) : ( 1 ) } @{ $_[0] }...
Rancho's user avatar
  • 309
0 votes
1 answer
173 views

im using array_diff to check if ALL needles exist // my code $needle = array(' b', 'asb'); $haystack = array('a','b','c','d','e'); if (empty(array_diff($needle, $haystack))) { ...
pramudityad's user avatar
1 vote
3 answers
551 views

So I have list A and list B. A is of size n and B is of size n + 1. I need to know if all elements in A are the same as all elements in B.sublist(0, n - 1). A: [5,7,2,9] B: [5,7,2,9,1] true A: [5,...
nicoqueijo's user avatar

1
2 3 4 5
7