Questions tagged [time-limiting]
128 questions
0
votes
0 answers
activity selection problem time limit error
Im trying to solve the activity selection problem but do not understand how to improve my code to avoid the Time Limit Error (TLE) . Please suggest what went wrong in this simple question .
question :…

Ayush Agarwal
- 5
- 2
0
votes
0 answers
TimeLimiter is not stopping the method execution and going to next step
Currently, we are facing an issue with a read timeout for a DB call. I am trying to add a time limit on the method to wait for only 3 seconds. If the method doesn't return data in 3 seconds my execution goes to the next line. I tried to achieve this…

jyothi reddy
- 1
- 1
0
votes
1 answer
What Did I Miss in Input Process?
I am solving a problem in Hackerearth. Passed all the test cases except 1, showing "Time limit exceeded". What did I really miss in my code?
package main
import(
"fmt"
"strings"
)
func rotateRight(numbers []int, size int, k int) []int {
…

ZamaaN
- 63
- 1
- 6
0
votes
0 answers
I have a time limit exceeded error for my conditional statement
leetcode problem:
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You…

Hans
- 49
- 1
- 7
0
votes
2 answers
a function to Print the summation of numbers between A and B inclusive that are divisible by X
Given three numbers A, B and X. Print the summation of numbers between A and B inclusive that are divisible by X.
Example :
Input : 5 20 5
Output : 50
Explanation: The numbers [5, 10, 15, 20] are dividable by 5 then the result: 5 + 10 + 15 + 20 =…

Hassan Ahmed
- 11
- 3
0
votes
1 answer
Leetcode 1131. Maximum of Absolute Value Expression Problem
Given two arrays of integers with equal lengths, return the maximum value of:
|arr1[i] - arr1[j]| + |arr2[i] - arr2[j]| + |i - j|
where the maximum is taken over all 0 <= i, j < arr1.length.
Example 1:
Input: arr1 = [1,2,3,4], arr2 =…

ThaJokerKid
- 11
0
votes
2 answers
How to implement time limit in Docplex
I am using Docplex (Cplex python version) with a minimization objective. As it takes a long time to find the optimum I would like to set a timelimit and receive the found solution at that time.
To limit the time I have tried the following but it…

Mado_xx
- 1
- 2
0
votes
0 answers
Why am I running into a Time Limit Exceeded Error on CodeChef when the Time clocked is 0 seconds when I submit my code?
This question relates to my code running into Time Limit Exceeded Error on Codechef- although the time clocked is 0 seconds?
Here is the problem I am trying to solve:
https://www.codechef.com/SEPT21C/problems/MNDIGSUM
And here is my code:
Q =…

Patrick_Chong
- 121
- 7
0
votes
1 answer
I am getting this error while compiling this code "Time Limit Exceeded Your program took more time than expected."
I keep getting this error while compiling this code
Time Limit Exceeded
Your program took more time than expected.Time Limit Exceeded
Expected Time Limit 1.02sec
Hint : Please optimize your code and submit again
##Write the function completely
…
user13185880
0
votes
2 answers
Python Code Optimization Problem (Lintcode Problem 1886 Moving Targets)
I have been working on a problem on https://www.lintcode.com/ and I have ran into a problem while doing one of the questions. The problem requires me to write a function with two parameters. A list of nums and a target num. You have to take all…

CoderTang
- 460
- 5
- 14
0
votes
1 answer
Im having a 'time limit exceeded' error in this code can anyone
So the code is to calculate the cost of each colony, where the earth is the top one, like a tree,and the rules are the cost for the leafs is the cost they need to take to reach earth, and for the middle nods it depends they can go to the earth or to…

Guilherme Nunes
- 27
- 4
0
votes
1 answer
CPU Time Limit does not work in docplex api in python
I have set up docplex api in python and I am trying to run an optimization models. Based on IBM documentation, a CPU time limit can be set for the problem using the following command:
mdl.solve(TimeLimit=60)
However, this attribute does not work…
0
votes
1 answer
Is there a way to speed up my python program on graphs?
Given with a matrix NxM. There are '.' - cells you can visit, and '#' - cells you can't visit. You can only go up, down, right and left (not diagonal). Also given q request, in each there are row and column of a cell needed to swap (if cell is '#'…

chickysnail
- 51
- 5
0
votes
1 answer
Which is a better option in azure for providing time limited access to an azure storage account?
I am not sure of the trade-offs between using an access policy for providing time limited access to an azure storage account versus using a shared access signature, since I have always used the shared access signature. Once again, kindly provide…

Bharat
- 2,409
- 6
- 32
- 57
0
votes
1 answer
Is there a bug with using timelimit within pulp in python using CPLEX?
I am currently writing my thesis, where I want to implement an algorithm to converges towards a good solution using a large OR model.
I can include the model, if you will need it to answer my question or better yet understand my question.
When I run…