Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
55 views

Please verify my understanding, but I believe the time complexity of this solution can be described as O(row * column * column) due to the presence of Math.min() and array.slice() operations within a ...
Tui's user avatar
  • 195
2 votes
1 answer
148 views

I am attempting to run a dynamic optimization model in discrete time with GEKKO and IPOPT (v3.10.2). My model is the following : from gekko import GEKKO import numpy as np # Simulation time T = 5 ...
GaL's user avatar
  • 103
0 votes
1 answer
59 views

I am working on a functionality in which i will make a build for DEV environment and deploy on DEV domain . Further , without rebuilding the application again for QC environment , i want to make use ...
Akshita Tyagi's user avatar
0 votes
1 answer
108 views

This is the Question... The following problems revolve around an adventurer who enters a dungeon in search of Gold (Treasure). The objective for all the questions will be to find the quickest path to ...
Mohideen Irfan's user avatar
6 votes
2 answers
456 views

You are given a matrix V of dimensions m × n, where each element represents the prices of m different vegetables seeds for n consecutive days in a produce market. Furthermore, you are given an integer ...
WolfgangBagdanow's user avatar
2 votes
1 answer
2k views

There are n houses along the street, and we need to color every with one of 3 colors but there are 2 constraints: Adjacent houses need to have different colors Symmetric houses cannot have the same ...
duckrabbit's user avatar
3 votes
4 answers
4k views

I got this question for a coding interview (mock, part of my uni's competitive programming club since a few people are curious lol), and I got stuck on finding the optimal solution. Extra details/...
Yajax's user avatar
  • 95
0 votes
1 answer
124 views

Well i have tried it many time and still unable to find the error in the code below it is making change proble using dynamic programming need help to eliminate the wrong output and if possible plz ...
Pulin Mori's user avatar
1 vote
1 answer
142 views

I am trying to solve this problem (https://open.kattis.com/problems/robotsonagrid). And when I submit my final code I keep getting a Run Time error in Test case 4. I am not sure what's wrong with my ...
Smart KIm's user avatar
4 votes
1 answer
504 views

I have a classic interview problem to ask but it is with a twist: You are given the stock prices for n days, a1, a2, ..., an. You are also given an integer 1 <= k <= n. Each day, you can do one ...
MangoPizza's user avatar
1 vote
0 answers
132 views

Sam recently hired a tile installer to tile a kitchen floor. The floor was supposed to be very colorful with no two adjacent tiles having the same color. Unfortunately, the installer failed to ensure ...
Roy A.'s user avatar
  • 13
-1 votes
1 answer
421 views

I am working on a LeetCode problem, 518. Coin Change II: You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. ...
Paurab Bhattacharjee's user avatar
-1 votes
1 answer
87 views

I have been stuck on this LeetCode problem Number of increasing paths in a grid: You are given an m x n integer matrix grid, where you can move from a cell to any adjacent cell in all 4 directions. ...
Nikhil Sharma's user avatar
1 vote
0 answers
22 views

class Solution: def combinationSum4(self, nums: List[int], target: int,memo={}) -> int: if target in memo: return memo[target] if target==0: return 1 ...
Kaustubh's user avatar
1 vote
1 answer
163 views

How would I go about to write a function that takes the name of a component and property and a JSON value string and populate that component's property with the value dynamically? The property can be ...
JohanS's user avatar
  • 21
0 votes
1 answer
130 views

I'm trying to solve the following problems here: In the X world, companies have a hierarchical structure to form a large binary tree network (can be assumed to be a perfect binary tree). Thus every ...
driver's user avatar
  • 282
1 vote
3 answers
83 views

I'm attempting to generate all conceivable combinations of a given number using elements from a list. For instance, when the number is 4 and the list contains [1, 2], there are 3 possible combinations:...
iis2h's user avatar
  • 31
0 votes
2 answers
157 views

I have a matrix of 6 columns and 375 rows, the user sets any number. The task is as follows, find all combinations in which a number is taken from each column (a total of 6 numbers) and their sum ...
Sigel Alex's user avatar
0 votes
0 answers
42 views

Geek's Journey You're provided with two arrays: "geeksTown" of length n - representing the heights of buildings in Geek's town "journey" of length m - representing the ...
Tejas x's user avatar
1 vote
0 answers
52 views

I am using sddp.jl for my research project in which I am developing a state-of-the-art actor critic algorithm which I am going to benchmark with SDDP but for it I need to plot graphs which require ...
Engr. Moiz Ahmad's user avatar
-1 votes
1 answer
140 views

In a circular list of length n, where a1 is adjacent to a2, a2 is adjacent to a3, and an is adjacent to a1. Each operation can delete one number, after each deletion, if there exists adjacent equal ...
Yu Xing's user avatar
  • 89
0 votes
1 answer
72 views

Regarding the "Boolean Parenthesization" problem, my code doesn't work. I tried the approach using the dynamic approach, however for the the input of N=5 and T^F|F, I got 0 as the output but ...
yash saini's user avatar
1 vote
1 answer
194 views

At every recursive call I choose 1 more of current denomination or no more of current denomination. I sort the denominations in descending order and use a cache of seen remaining amount. Since I try ...
Thomas's user avatar
  • 6,364
6 votes
1 answer
413 views

I understand there is a general pattern to solve dynamic programming problems. Consists of: Identify Overlapping Subproblem by Breaking down the problem into smaller subproblems that are solved ...
silenok sweet's user avatar
3 votes
1 answer
1k views

Problem: Given an array 'arr' and an integer 'k', find the maximum sum of all subarrays of 'arr' whose size is at most 'k'. Note that you can't choose subarrays which are consecutive or overlap each ...
Shirina's user avatar
  • 45
0 votes
0 answers
29 views

I'm currently doing the "Word Break" problem in LeetCode. It is a dynamic programming problem with the difficulty "Medium". For some extrange reason, the exact code (but without ...
gerocastano8's user avatar
-4 votes
1 answer
228 views

Trying to find the shortest path through a dynamic programming approach but it doesn't seem to be working below is the code of the algorithm and the graph class. I tired to store the paths through a ...
Adel Sabboba's user avatar
-1 votes
1 answer
57 views

I have two method, the difference is one is having --i1 and other is having i-1, however they are producing different output. String s1 = "axbdcg"; String s2 ="...
DARK FOREST's user avatar
0 votes
1 answer
26 views

this is the tabulated version of gridTraveler, where you output the number of ways one can travel from the top left to the bottom right corner in an m*n box, but you can only move down or right. const ...
LoVrO312's user avatar
0 votes
1 answer
979 views

I have a problem in AX 2012 when I call API by Https URL give me this error (The request was aborted: Could not create SSL/TLS secure channel) but when I test code in Dynamic 365 It Work This My code: ...
Saleem Alayyan's user avatar
2 votes
0 answers
269 views

If there is a list of digits in string format, e.g. ["1", "5", "8"], list of valid operations are "+","-", and "*" and a target number. Find ...
Alan's user avatar
  • 469
4 votes
2 answers
143 views

Richard is a penguin who regularly commutes between Canada and the United States. Specifically, Canada is at location 1 , and the United States is at location N. In locations 2 through N, there are ...
Derek Feng's user avatar
-1 votes
1 answer
25 views

You're given a list of integers, you must add the integers to one of two lists, each of these lists has the same capacity that the sum of ints inside the list must be under. This is just a rough ...
Jack Bogart's user avatar
0 votes
1 answer
180 views

maximum sum of an integer array such that if we consider an element a[i] then we should not consider a[i]-1 and a[i]+1. for example if array a = [1,1,1,1,1,2,2] the o/p = 5 and if a = [3,3,3,4,4,8,1] ...
Pavan kalyan's user avatar
0 votes
1 answer
57 views

I have written this following code that takes an integer N and and array of integers: arr. The task is to find the shortest combination of the integers in arr that sum up to N . Each elements of arr ...
Non_CS_Dude's user avatar
0 votes
1 answer
1k views

in gdscript (using godot 4.1.1 stable) i am working on a function that adds a checkbox dynamically works fine but when i try to get it to do something when it is toggled i get all sorts of errors this ...
Mike's user avatar
  • 79
-2 votes
1 answer
222 views

I am trying to solve a problem here https://leetcode.com/problems/word-break/ . My code looks like below:- bool existsInDict(string s, vector<string>& wordDict) { if(std::find(wordDict....
Invictus's user avatar
  • 4,418
0 votes
0 answers
263 views

Taking a class on algorithms - trying to understand what is meant by the 'count of a subproblem' when discussing dynamic programming. The scenario I'm faced with is as such: An investor wants to ...
Jean-Paul Azzopardi's user avatar
0 votes
1 answer
414 views

Solving [leetcode problem][1] which is as follow: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. ...
curiousengineer's user avatar
0 votes
1 answer
143 views

I'm looking for the most efficient way of solving an Levenshtein edit distance problem. We are given as input: A set of strings S of size n <= 8, with average length m <= 50 A target string t of ...
Mathguy's user avatar
  • 157
0 votes
1 answer
59 views

the code is very simple i am taking or not taking an element from A array and using left i am keeping track left sum it is interview bit problem Subset Sum Problem! class Solution: def solve(self,...
Sanjay's user avatar
  • 1,017
1 vote
4 answers
344 views

I am trying to find a formula to find the mode of the highlighted cells. The value inside cell D13 will determine the number of highlighted cells. If it is 3, 3 rows will be highlighted starting from ...
StudentOfLife's user avatar
2 votes
1 answer
835 views

The problem is as follows: Problem: "Your car starts at position 0 and speed +1 on an infinite number line. Your car can go into negative positions. Your car drives automatically according to a ...
punypaw's user avatar
  • 135
4 votes
2 answers
229 views

I have this problem that I'm trying to solve: Given two numbers K and S, determine how many different values of X, Y, and Z exist such that 0 ≤ X, Y, Z ≤ K and X + Y + Z = S. Now, what I did is a ...
Super's user avatar
  • 55
0 votes
0 answers
131 views

So basically in this problem we have a knight (from chess) and a keypad from a phone. Using the possible moves for knight (i.e. 'L' shape) we have to find the total count of phone numbers that can ...
Adithya's user avatar
0 votes
2 answers
106 views

I'm working on this Leetcode question. I cannot figure out the difference between my commented and uncommented code below. I'm returning an array at the base-case of a recursion, so when I call the dp(...
cjames's user avatar
  • 75
0 votes
1 answer
211 views

The code is supposed to produce a two dimensional list of all the possible ways a target can be reached from a list of word bank but the actual output confuses me. Is there a better way to tackle this ...
Ogbonna Stanley's user avatar
0 votes
2 answers
3k views

You have an array of integers. You can delete as many elements as you can from the array and return the maximum beauty of the array. Beauty of the array is number of elements in the array which have ...
Nithya N's user avatar
1 vote
1 answer
1k views

I am looking into an interesting issue in networks. Given an undirected graph which can contain cycles: I choose two points, A and B as origin and end of my paths. My goal is to calculate how many ...
user16786403's user avatar
0 votes
1 answer
201 views

Diff Between Two Strings Given two strings of uppercase letters source and target, list (in string form) a sequence of edits to convert from source to target that uses the least edits possible. For ...
vamsi bharadwaj's user avatar

1
3 4
5
6 7
115