Category "arrays"

What does the Array method `reduce` do?

I found a very useful function reduce, and I'm using it, but I'm not sure if I understand it properly. Can anyone help me to understand this function? Example:

Randomise each element of String from inside? [duplicate]

I am trying to change the place of characters in a string. The first and last have to stay like they are. For example: String str = "String te

Pushing value to array that is the value of an object

I have the following structure: let mappings = { "1002": ["1000", "1003"], "2000": ["2001", "2002"] } and I want to add this piece of data const issueT

arrays and methods help needed

i've been puzzling over this for about 5 hours now, I just can't get the errors to stop. am I doing something fundamentally wrong, or misunderstanding something

How to optimise a condition which checks for each object of an array of objects whether specific properties are not undefined?

I want code optimisation for an if-statement because I otherwise have to add more key-value pairs into this condition with &&. I have an array of object

Arrays sorting Program

you are given a stream of integers represented by an array[ ] of size N. Whenever you encounter an element arr[i] , you need to increment its first occurrence (

Use an array as chart values

I need an array with chart values, I obtained one but after exiting from the function it became blank, here's what happens: Example function AddvotoTec(voto

How to delete certain number from a list in list using the index in python?

I have a list in a list, and I am trying to delete the third number of each sublist, but every time I am getting an error TypeError: list indices must be intege

How to delete certain number from a list in list using the index in python?

I have a list in a list, and I am trying to delete the third number of each sublist, but every time I am getting an error TypeError: list indices must be intege

Java How to validate characters using a string?

I am working on a java project and was wondering how I could use a string to determine whether or not the chars in an array are valid. The given string is final

dynamically get columns from 2D array

I have a 2D array of row,through which i want get the column coordinates/information just like i got for the row(rowArr2D) So,in my Column(colArr2D) i'm just ge

Trying to print or access value inside a multidimensional VBA array

'For the most part, I understand how arrays work but apparently not multidimensional ones in VBA. Below is a simple subroutine in which I want to debug.print/ac

Fetch data from database where logged in user id exist in an column that stores ids as an array Laravel 8

I want to get the rows in a database where logged in user exists. Here is my structure Table = Meetings Column = Participants (stores an array of users eg.["1",

Converting an array into a linked list in Golang

definition of linked list: type ListNode struct { Val int Next *ListNode } insert helper that does the pointer manipulation: I am aware that root.Val

List.Remove All not removing the negative numbers from textfile

Here's what I want this code to do. Read the textfile random.txt into a List For each line of the textfile read into the list I want to determine if it is posit

How to split a readLine but dont split values inside apostrophes?

Example txt file ADD 'Cordless Screwdriver' 30 1 2 COST 'Multi Bit Ratcheting' FIND 'Thermostat' FIND 'Hand Truck' SELL 'Hammer' 1 QUANTITY 'Paint Can' FIRE 'Jo

How to change the final array to the front in JavaScript?

The case is: function trocaPrimeiroEUltimo(array) { array.array[0] array.array[array.length - 1] return array } I did this way, but it didn't work.

I am trying to take the contents of fa plain txt file and put it into a char array, then I would like to print it out of the array

#include <stdio.h> #include <fstream> #include <string> #include <iostream> #include <cstdlib> using namespace std; int

How can I transform rows to columns? [duplicate]

I have this table with data below and need help because I don't know which formula can I use to convert the table into the desired one. I don'

Extract value from array in Spark

I am trying to extract a value from an array in SparkSQL, but getting the error below: Example column customer_details {"original_customer_id":"ch_382820","fi