// C > Arrays and Strings > Dynamic Array in C // // // https://www.hackerrank.com/challenges/dynamic-array-in-c/problem // #include <stdio.h> #include <stdlib.h> /* * This stores the total number of books in each shelf. */ int* total_number_of_books; /* * This stores ...
/** * https://www.hackerrank.com/challenges/dynamic-array/problem * */ class DynamicArray { var lastAnswer = 0 var answerList: ArrayList<Int>? = null var seqs: ArrayList<ArrayList<Int>>? = null fun dynamicArray(n: Int, queries: Array<Array<Int>>): Array<Int> { seqs = ArrayList<...
Where is my logic wrong in this dynamic programming problem? I'm trying to solve https://www.hackerrank.com/challenges/summing-pieces and I think I have come up with an O(n) solution although the numbers aren't coming out exactly right. The problem is essentially to find a sum like ABC...
optimization ,can we always say that it is possible to use in a system where we have to minimize the sum of cost of k continuous segments( such that their union is the whole array and their intersection is null set) such that the cost of segment increases with increase in length of ...