All Questions
8 questions
-2
votes
1
answer
65
views
why is it different to print statement within the inner loop and outside the inner loop?
I was asked to print the number of negative subarrays. I used three loops to fix a starting position, ending position and a loop to print elements of subarray. I need to use count to check if the sum ...
0
votes
1
answer
140
views
Create dynamic sub array from a big one [duplicate]
I have an array, made by using explode and the delimiter #. I'm trying without success to create from this big array in PHP subarrays (the number of subarrays is not fixed and could vary). The goal is ...
1
vote
5
answers
138
views
JavaScript subarray Iteration
I want to capitalize the first letter of every word in a string.
I want to know why this is not working:
function titleCase(str) {
str = str.toLowerCase().split(" ");
for(let i = 0; i<...
2
votes
6
answers
102
views
Grouping Subarrays in Arrays
I'm wrapping my head around the following logic, but I'm still missing something.
Given an Array like const testArr = ["F", "F", "C", "C", "F", "...
0
votes
4
answers
151
views
How to add a new property to a subarrays?
I have an array with subarrays, I'm trying to add a new property title to each subarray. I have an implementation, but instead of adding the title to each subarray it puts it at the end of the array
[...
1
vote
1
answer
564
views
Traversing all the subarrays of a 2-D array
I have a 2-D array given of size P*Q and I have to answer K questions based on the array. The 2-D array given consists of numbers 0 and 1. For each question, we have to count the maximum size of any ...
-1
votes
1
answer
1k
views
find a largest sum contiguous sub array from a given array consisting of integers
I am writing a code to find the maximum sum contiguous sub array in C. The logic seems fine according to me, but still the output is not correct. Please look into the code.in the three loops the ...
0
votes
1
answer
152
views
Non Executing Loop and Sub Array
I am trying to find the most number of consonants in a row for a specific word in an array. I have a while loop in the middle that I have commented, but for some reason it does not execute. Does ...