Category "arrays"

Iterate through array 1000 items at a time in an array of thousands

I want to loop through an array consisting of thousands of items. I want to process thousand item at a time. Is there a better way to achieve this ? const a = [

convert List of string array into xml

I need to convert list of array into xml. In the list the first object is the elements of the xml and from second object onwards it is the values of the element

How to execute class method in a Java program? [closed]

In this code, we have to add a method set() which will take two parameters, an int index, and an Integer value, which will set the array eleme

SwiftUI View not updating based on @ObservedObject

In the following code, an observed object is updated but the View that observes it is not. Any idea why? The code presents on the screen 10 numbers (0..<10)

Airplane seating program (2 dimensional array)

I have an airplane seating program but I don't know how to get it to print the number of seats still available and how to get it to quit when I enter q. Any he

how to retrieve the first and last instance of a row in pdo dataset

I have a dataset that I retrieve using PDO and fetchall. I need to find the first date a part was sold and its cost then also I need to find the last date that

How to order an array of object during a forEach()?

So, basically I have this array of objects and I need to order them dependently on the value caricoData, which is a date. Problem is, the value is a string and

Print Diamond shape - Solution in Recursion [closed]

Each line has size 2n+2 The top line begins with n+2 spaces, followed by the uppercase 'o' character, followed by +2 spaces Each lines from

Save BigQuery results to array

I have a query that looks like this SELECT ids FROM `table_name` The results set is as follows | ids | |-----| | 1 | | 2 | | 3 | I need to save this res

Structure formData in an array

I have an extensive form and I'm trying to organize this so that it remains practicable for the plan that I intend to have with it. An example showing what my f

Find sorting algorithm for an elevators floor travel schedule, starting from the current floor with preselected floors to reach and a travel direction

I'm making an elevator in react, But I need to make a function that sorts an array to the nearest to the number X and also there is a condition if the elevator

How do I bold the first Item in my array only, while leaving the rest normal?

so I want to bold the first Item in my array of this typewriter effect. you can see below the type of effect I'm going for. Judaism is <strong> A Religion

Java getJSONArray when it is set to null

The problem happens when I'm trying to get children of a comment. If the child key is null, my application crashes and gives me this error: org.json.JSONExcept

Using VLOOKUP with two lookup values while using IMPORTRANGE to merge three Google Sheets

I have created three google sheets wherein one google sheet is designed as the Masterfile for the data present on the two other google sheets. I was able to mer

How to replace min and max value row in 2-d array python

i have an 2-d array(matrix) 3x3 like [[1, 2, 3],[4, 5, 6],[7, 8, 9]] and i need to replace 2 rows where is max and min value so its looks like: [[7, 8, 9],[4, 5

Faced an error: excess elements in char array initializer during print out of array of strings

I've tryed to print out some array of strings but faced error: excess elements in char array initializer Please make a hint what's worng with this code? Step 1

Jest: test that an array contains none of these values?

I want to verify that a given array doesn't contain any of a list of values. There is expect.arrayContaining but I don't get how it is supposed to be used for t

Binary search program cause runtime error and failed hidden test cases

I am practicing binary search with problem 704 on leetcode. At first, I just follow the concept of binary search and came up with this solution: int search(int*

How to sort array of objects by dates and make new arrays which will contain all objects with same date [closed]

I have a very specific problem in Javascript. I have array of objects, and each object contains some date. const array = [ {name: 'first', dat

How can update values in an array of objects?

how to get new array newSelect using map ,forEach const selects = [false, true, true, true, false]; const oldSelects = [ { select: true, name: 'AA' },