Skip to main content
-3 votes
0 answers
56 views

Suppose we have an π‘š*𝑛 grid, let 𝑖=0,...,π‘šβˆ’1 and 𝑗=0,...,π‘›βˆ’1. For each grid point we have an array 𝑆𝑖𝑗 of size 𝑁 that serves as local score function. We want to to find a way that assigns ...
Peter Wu's user avatar
  • 279
-3 votes
0 answers
58 views

You are given a NΓ—NNΓ—N 2D grid representing possible quantum states, where each cell contains a 32-bit unsigned integer. Your task is to find a continuous path from the top-left (0,0) to bottom-right (...
SaujasByt's user avatar
5 votes
1 answer
288 views

I'm working on a problem where I need to count, for each possible common difference D, the number of contiguous subarrays whose elements can be rearranged to form an arithmetic progression with common ...
YAR's user avatar
  • 53
0 votes
0 answers
74 views

Problem Statement There are N items, numbered 1, 2, …, N. For each item i (1 ≀ i ≀ N): It has a weight w[i] It has a value v[i] Taro wants to choose some of these N items and carry them home in a ...
Plague's user avatar
  • 1
2 votes
1 answer
193 views

I do not know when to use backward or forward computation for tabulation in solving a dynamic programming problem. I would like to know the thinking process to decide which one to use or which one ...
user avatar
-4 votes
1 answer
273 views

I'm working on a combinatorics problem where I need to compute how many ways the set {1, 2, ..., n} can be divided into two subsets with equal sum, such that every number from 1 to n is in exactly one ...
Nam DΖ°Ζ‘ng VND18 VΕ©'s user avatar
0 votes
1 answer
112 views

I'm looking at one of the solutions to the programming problem: Partition a Set into Two Subsets of Equal Sum. The programming problem: Given an array arr[], the task is to check if it can be ...
charactersum's user avatar
1 vote
1 answer
106 views

Does anyone know any LeetCode, Codeforces or anything like the following programming problem?: Imagine you have "n" slots, from 1 to "n" with "s" being your starting ...
Casper Kejser's user avatar
9 votes
2 answers
264 views

A valid shuffle of two strings A and B is when their characters are mixed together to form a bigger string and all characters are used and the string is such that the order of characters in A and B is ...
Inclatable's user avatar
-1 votes
1 answer
69 views

There are several descriptions of the Floyd-Warshall algorithm, including the one in Wikipedia where path tracking logic described like in the pseudo-code below (copy from Wikipedia https://en....
RomanGirin's user avatar
0 votes
1 answer
88 views

class Solution { public: int change(int amount, vector<int>& coins) { vector<unsigned int > dp(amount+1, 0); dp[0]=1; for (int value: coins){ ...
OXEN's user avatar
  • 13
5 votes
2 answers
133 views

In the classic subset sum problem, there are a set S and a target t, and the goal is to find a subset of S whose sum is t. This variant has a pseudo-polynomial time solution. In a variant of the ...
Samuel Bismuth's user avatar
6 votes
1 answer
178 views

Problem description: A mailbox manufacturer wants to test a new mailbox prototype's durability based on how many fire crackers it can withstand. Given k identical mailboxes (each holding up to m ...
Karma's user avatar
  • 77
0 votes
0 answers
44 views

I have a table like below create table public.test_dynamic_data_tbl(col1 int,col2 character varying,col3 double precision); insert into public.test_dynamic_data_tbl values(1,'test1',12) insert into ...
Amar's user avatar
  • 1
0 votes
0 answers
55 views

How can the following recursion + memoization code be converted into a tabulation format dynamic programming solution? The code is working but I want to improve it. The challenge I am facing is ...
Elias El hachem's user avatar

15 30 50 per page
1
2 3 4 5
…
381