I'm using ajax to submit a multipart form with array, text fields and files. I append each VAR to the main data as so var attachments = document.getElementByI
I have created a multidimensional array in JavaScript and I want to find the exact index of specific value. That value will be user input. var array = []; var k
There's an array say [1,2,4,5,1]. I need to print all the contiguous sub-arrays from this. Input: [1,2,4,5,1] Output: 1 1,2 1,2,4 1,2,4,5 1,2,4,5,1 2
I'd like to copy a numpy 2D array into a third dimension. For example, given the 2D numpy array: import numpy as np arr = np.array([[1, 2], [1, 2]]) # arr.shap
Here is the question: Write a solution that only iterates over the string once and uses O(1) additional memory, since this is what you would be asked to do duri
I already know that apply and call are similar functions which set this (context of a function). The difference is with the way we send the arguments (manual vs
I have a simple array. The array length always has a square root of an integer. So 16, 25, 36 etc. $array = array('1', '2', '3', '4' ... '25'); What I do, is
I have a simple array. The array length always has a square root of an integer. So 16, 25, 36 etc. $array = array('1', '2', '3', '4' ... '25'); What I do, is
I am trying to output the names and corresponding scores in descending order. Having an array of strings and another array of integers, I am trying to relate th
Given an array of integers, I need to return a new array containing the middle element(s) from the original array. Specifically, the result will have one elemen
I need help to assign keys to an array in PHP. My code is: //First I make an array of a csv file $file="C:\path-to-csv\file.csv"; $csv= file
Let's say that I have this code: class Stat { var statEvents : [StatEvents] = [] } struct StatEvents { var name: String var date: String var hours
I have this array: Array ( [7] => 12 [5] => 11 [4] => 11 [2] => 9 [8] => 7 [1] => 6 [3] => 6 [6] => 5 [23] => 3 [3
I have this array: Array ( [7] => 12 [5] => 11 [4] => 11 [2] => 9 [8] => 7 [1] => 6 [3] => 6 [6] => 5 [23] => 3 [3
I have two arrays, and I want all the elements of one to be divided by the second. For example, In [24]: a = np.array([1,2,3])
Write a program to print the sum of all the elements of an array of size N where N can be any integer between 1 and 100. (1 \le N \le 100) Ins
I have the following array and when I do print_r(array_values($get_user));, I get: Array ( [0] => 10499478683521864 [1] => 07/22/1983
Seemingly simple question: I have an array with two columns, the first represents an ID and the second a count. I'd like to update it with another, similar arr
Array.prototype.reverse reverses the contents of an array in place (with mutation)... Is there a similarly simple strategy for reversing an array without alter
I've seen a few examples of this but all of those seem to rely on knowing which element you want to count the occurrences of. My array is generated dynamically