15 questions
4
votes
5
answers
321
views
How to effectively code to check if two arrays with the same number of elements has the same elements even if in different positions?
I was trying to solve this problem: Given a number N and two arrays of A, B of N number of elements determine if B contains the same elements as A (not necessarily at the same position).
There will be ...
4
votes
1
answer
734
views
Type-juggling in php: bypass a comparison with non-empty array
On an CTF for my web-security-class I was able to find following php-code on the server
<?php
$user = array("user" => "admin");
$secret = random_bytes(20);
...
1
vote
1
answer
73
views
Comparing two different string elements of the same multidimensional array in Java
I'm currently doing a practice question for an upcoming practical exam and am stuck. I've written a method to check whether a set of three cards is valid or invalid where we're told that "Two ...
0
votes
1
answer
122
views
Find item that changed its position in array
I have an array that represents html items that can be dragged and therefore the order can be changed. Let's say before drag'n'drop event there is an array:
let oldArr =
[{id: 'id1'}, {id: 'id2'}, {...
0
votes
2
answers
398
views
Creating a list of an object which either does or doesn't exist in another different object list - C#
So I am trying to compare two different lists that both contain differently structured objects. One is easily accessible while the other is very nested in arrays, but sadly, these are responses from ...
1
vote
2
answers
64
views
String[] Array variable comparison
I am writing a code that vaguely simulates a poker game, which at this point should output a "Players Hand", an "Opponents Hand" and a "Flop".
Each card should only ...
0
votes
1
answer
140
views
How to test if nested arrays are equal to each other
I have a maze generator that generates walls per "cell". This means that there are duplicate walls - e.g. the left wall of one cell is exactly the same as the right wall of the cell to the ...
1
vote
0
answers
85
views
Exact and case insensitive array comparision in mongoose
Suppose, below is the features array already exist in my database records:
const features = [
'Multiple Admin Users',
'Distribute Units',
'Unit Reports',
'Track Single Unit',
'Commercial ...
0
votes
1
answer
145
views
Comparing Two Arrays in Javascript to Find Identical Similarities and Other Similarities
I have two arrays in Javascript: code and submittedCode. I am trying to compare the two arrays. Each of the arrays is 4 integers long, and each integer is a random value of 1 to 6. I also have two ...
1
vote
1
answer
977
views
How to compare arrays in GROQ
I have a blog with sanity CMS and I want to request related posts depending on corresponding tags from the current post which means I have to compare two arrays of tags.
My tags are described in post ...
0
votes
0
answers
81
views
What is the reason for do in=false in the below script
I am doing bash and I was looking at a problem for array comparison and this was the solution below. I was wondering why they have the do in=false
#!/bin/bash
# enter your array comparison code here
# ...
0
votes
1
answer
161
views
Analysing two arrays for mastermind game
My main default is the logic for the analysis. What is demanded.
The processing algorithm in the analysis function is the main interest of the exercise.
I need to compare the player proposition called ...
1
vote
0
answers
308
views
Compare two items of the same array in JavaScript
I'm using react for this code. For a time now I been searching for how to do this, I have a array of arrays, and I need to compare if the beginning of the array is equal to beginning of the other ...
-2
votes
1
answer
110
views
How to get the difference between two arrays in JavaScript with repeating values
How can I check to see if one array is contained in another and return the missing values? I have found ways to do this in this post but none account for repeating values in the arrays. For example, I ...
2
votes
1
answer
3k
views
Compare two arrays in PostgreSQL
I have a table in postgres with a value column that contains string arrays. My objective is to find all arrays that contain any of the following strings: {'cat', 'dog'}
id value
1 {'dog', 'cat', '...