All Questions
5 questions
1
vote
2
answers
134
views
I want reduce the time complexity for this ladder problem to find the minimum ladders required
I was trying to attempt below given challenge. I tried multiple ways to solve the problem but none of them were good enough to pass the time limit. Please advise if you have any idea to improve on ...
2
votes
2
answers
225
views
Knapsack performance issue
I'm solving a knapsack problem here. It works, but gives time limit exceeds on a certain test case.
Problem statement
There are N
items, numbered 1,2,…,N. For each i (1≤i≤N), Item i has a weight of ...
5
votes
3
answers
3k
views
Maximum path sum in a triangle with prime number check
I was given this algorithm task:
You will have a triangle input below and you need to find the maximum sum of the numbers according to given rules below;
You will start from the top and move ...
2
votes
0
answers
3k
views
Hackerrank: Max Score
Problem statement
Consider an n-element sequence of integers, A = {a0, a0, ..., an-1}. We want to perform \$n\$ operations on \$A\$, where each operation is defined by the following sequence of ...
5
votes
1
answer
1k
views
Hackerrank: Lucky Number Eight (Dynamic Programming)
Problem statement
Given an n-digit positive integer, count and print the number of subsequences formed by concatenating the given number's digits that are divisible by 8. As the result can be large, ...