Category "arrays"

Match variable value to array's index to get month

example of getDepart date format getDepart = 2022-04-29 desired result 29 APR, 2022 const getStringDepart = () => { const months = ["JAN", "FEB", "MA

I'm trying to make a function that takes a 2d array as a parameter and outputs a normal array containing every unique number, in java

The function needs to have a 2d array as a parameter and then return a normal array with all the unique numbers. If the 2d array is [ [1,1], [4,2] ] then it sh

C code collecting info through a function and passing it back, of datatype struct

//Program is to collect input from user so that can pass the array of inputs from the user to another print function but that are quite some Errors in the code

How to delete a heap allocated std:::array

I have this pointer in a class: std::array<std::array<std::array<Item*, XSize>, YSize>, ZSize>* Items; In the constructor: Items = new std::a

Sort a subArray by based on order of Array in php?

I have a big array as $orderArr: $orderArr = array("IZQ", "AOH", "VNP", "ICW", "IOQ", "BXP", "SHH", "EAY", "ZAF", "CUW"); which looks like Array ( [0] => IZ

Convert image in list of coordinates in Julia

I have this short code img_lab = rand(Lab, 10, 10) where I just have created an image of random colored pixels. Probably this question is trivial but how do I c

Inserting a new entry into a 1 dimensional numpy array without distrubing other entries [duplicate]

Consider the following: If I have a 1 dimensional array like the following import numpy as np x=np.array([1,2,4,5]) Say now that I have the n

Updating 2D array in python [duplicate]

size = 10 table = [[0] * size] * size for iter in range(size): table[iter][iter] = 9 for iter in range(size):

array.slice strange behaviour with nuxt-edge

EDIT AND SOLVED: I've found the origin of the problem: I thought arr.slice returned the new array but, actually, it returns the deleted element. See the documen

I’m trying to sum the return value of 2 threads together but it return -1 saying error

I’m trying to make a program which sums the numbers in an array, the first half of the array by the first thread and the second half by the second thread

ReactJS - Convert to Array Mapping

How can I convert this link to a array mapping, I already tried making a array object with name, path, icons, and label properties. But when I do that the cart

Using a multiple arrays in order to find the lowest "Ranking" in an character defined ranking system

Wordy title but I was interviewed on this question, couldn't derive the answer and really would love to better understand array usage in excel. Question: You ha

question regarding max value in an array with recursion in JavaScript

Currently, I was able to get the following function to retreive the max value from an array through recursion const max = ([a,...rest]) => !rest.length || a

Code works (mostly). But failure to remove duplicates

Summary: Hey I've got a filter for some data. It's filtering fine but it's not removing duplicate objects. Arguments taken in order: 1. datasource 2. filters (r

Range Error(index): invalid value: valid value range is empty

im trying to set initial value for 'title' but it keeps showing me the error: range error (index): invalid value: valid value range is empty class _ProductCreat

Python - Matching close strings in two separate arrays

I have two different arrays populated with a number of string values and I would like to compare the two arrays and find the matches. The main problem is that t

how to check if the 2d array contain the requirement, and if yes, return the toal score in python

I have a 5 * 5 two-dimensional array, and a dice will be thrown 25 times. For each throw, the user needs to put the value into the two-dimensional array. Becaus

regexp_matches, array per row

In PostgreSQL, I have a table as follow. | id | mycolumn | | -------- | -------------- | | 1 | /1/2/8/ | | 2 | /1/40/22/11/ |

Issue with Generating Random Numbers using Laravel contains vs foreach loop [duplicate]

Hey guys I come across this strange issue where if I use the foreach it does not generate a unique random number wheres if I use laravel funct

Check if two arrays have an object with the same property

Here's my goal: compare two objects and figure out if there is 1 or more items in common. If there are 1 or more in common, return true otherwise (no items in