Category "arrays"

array implementation using python from scratch [closed]

My teacher has asked me to implement an array using python without using any inbuilt functions but I am confused and I don't know how to? this

Replace element at specific position in an array without mutating it

How can the following operation be done without mutating the array: let array = ['item1']; console.log(array); // ['item1'] array[2] = 'item2'; // array is mut

How to convert Java "Arrays.copyOfRange" function to C#?

Working on MergeSort in Java: public void mergeSort(int[] A) { if (A.length > 1) { int q = A.length/2; int[] leftArray = Arrays.

How to convert Java "Arrays.copyOfRange" function to C#?

Working on MergeSort in Java: public void mergeSort(int[] A) { if (A.length > 1) { int q = A.length/2; int[] leftArray = Arrays.

CountNonDivisible - Codility training task

I'm traning on codility now. Some tasks I can solve by myself, but with some tasks have problems. Difficulty of this task is <**>. It's medium, but I stal

Sum in a index/match formula

Could you help me solve the following? I want to return the total sum, not the first match that it finds. My first preference is have indexing and matching wi

Sum in a index/match formula

Could you help me solve the following? I want to return the total sum, not the first match that it finds. My first preference is have indexing and matching wi

Insert multidimensional array to codeigniter cart

I'm building online store using codeigniter and it's cart library. I have this array $data = Array ( Array ( [id] => BM101

Postman - dynamic variable for a value from array

How could I add an automatic environmental variable in Postman based on a value which is appearing in the endpoint response in the array? In the example below,

.filter() does not affect type of array in TypeScript?

check this snippet: interface Foo { id: string; } const fooFunc = (arr: Foo[]): Foo[] => arr .map((item: Foo): Foo | null => { const so

Is there an equivalent of JavaScript's indexOf for Rust arrays?

var fruits = ["Banana", "Orange", "Apple", "Mango"]; var index = fruits.indexOf("Apple"); let fruits = ["Banana", "Orange", "Apple", "Mango"]; let index = fru

Hex String to Byte array conversion java

I know this question is asked a lot of times but please hear me out. Previously I have tried following methods to convert hex string to byte array. say my key

Debugging ajax flow

I am really confused on a program that I made. A few days ago, it was working just fine, but now I am having problems with initializing it. I think I've figured

Pascal 'Split' Function

I am coding a little program in pascal and I have run into a small problem. In other languages there is a function named 'split' or 'explode' to take a long str

Find the longest word/string in an array

I just started learning JavaScript. I am trying to write a JavaScript to find and print the longest word in an Array. I came up with the code below: var longWo

Insertion sort error occurring in a C program

I am probably missing something simple here, but I was looking over some simple algorithms in C and have not been able to get the insertion sort in the code bel

How to fuse array in Lua

how can I fuse two array into one to be like: local array1 = {2272, 2271, 2270, 2269} local array2 = {2267, 2266, 2268, 2265, 2264, 2263, 2262, 2261} local fus

Checking already visited states in A* solution for 8-puzzle problem

I am working on a solution to the 8-puzzle problem using the A* algorithm for an university assignment, and currently working on a method to identify already vi

Why is memory adress getting printed instead the values of array in c+.+

When I'm trying to print the values of an array, its memory location is getting printed instead of values. What am I doing wrong? int main() { int list[3];

Inserting Country Selection into MySQL PHP [duplicate]

I'm currently developing a site that provides specific news events to users. The purpose of the site is to allow users to select which countri