Skip to main content

Questions tagged [time-limit-exceeded]

When the code scales so poorly in the face of large inputs that it cannot complete in a reasonable amount of time, use this instead of the [performance] tag.

9 votes
3 answers
2k views

Repeatedly remove a substring quickly

I'm trying to solve the USACO problem Censoring (Bronze), which was the first problem for the 2015 February contest. My solution works for some test cases, but then times out for test cases 7-15. I ...
user avatar
2 votes
1 answer
111 views

USACO Arithmetic Progression

The problem statement: An arithmetic progression is a sequence of the form a, a+b, a+2b, ..., a+nb where n=0, 1, 2, 3, ... . For this problem, a is a non-negative integer and b is a positive integer. ...
Michael Granger's user avatar
-2 votes
2 answers
141 views

Lower-Bound algorithm getting Time Limit Exceeded

...
Shakhawat Hossain SHIHAB's user avatar
0 votes
1 answer
301 views

HackerRank "Digit sum" challenge

Here's the question: ...
The Infinite Star's user avatar
2 votes
2 answers
95 views

For two sequences N and M, display counts of elements n from N below each m from M up to the first n above m

A school's task: There are two sequences n_tab and m_tab. For every element m in m_tab ...
Szyszka947's user avatar
3 votes
0 answers
40 views

Cross-classification of imagery from several regions in GEE

For a project I want to do the following: Use imagery from 17 different regions in Europe to train 17 RF classifiers Use those 17 classifiers to classify each of the regions It will be a multi-...
pottsbill's user avatar
2 votes
1 answer
117 views

Reviews a daily fantasy slate to check for duplicate lineups

My code below is used as a back testing tool to review a past Daily Fantasy Sports slate. This code works perfectly but when the contest size (total entrants) gets up to the 30,000 range it takes ...
safo2238's user avatar
1 vote
0 answers
112 views

USACO Silver "Wormhole Sort" solver

I'm struggling a bit with a USACO silver question using python, http://usaco.org/index.php?page=viewproblem2&cpid=992. The question provides an unsorted list of numbers (cows) and a number of ...
Luke's user avatar
  • 11
4 votes
2 answers
304 views

Wildcard Matching: LeetCode 44

Follow up post Link to question: Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*' where: '?' Matches any single character. '*' Matches ...
Loki Astari's user avatar
  • 95.4k
2 votes
1 answer
166 views

Dijkstra's Algorithm + an additional cost to start at each node

I am trying to solve the 2009 Canadian Computing Competition Senior #4. The question gives you a map (graph) of different cities, and the cost of transporting something between each city. There are ...
Justin Cheng's user avatar
0 votes
1 answer
2k views

sum of intervals kata in codewars

instructions for the kata: Write a function called sumIntervals/sum_intervals() that accepts an array of intervals, and returns the sum of all the interval lengths. Overlapping intervals should only ...
melike's user avatar
  • 47
2 votes
1 answer
188 views

Find numbers whose product equals the sum of the rest of the range

Instructions for the 'is my friend cheating' kata in codewars are: A friend of mine takes the sequence of all numbers from 1 to n (where n > 0). Within that sequence, he chooses two numbers, a and ...
melike's user avatar
  • 47
0 votes
1 answer
110 views

Effective encoding-decoding chain determination (time optimization)

Could you please help with speeding-up this code? Input: UTF-8 text (encoded 1-3 times from known pool of encodings). Every time was encoded and decoded by random encoding from pool. Original was koi8-...
Kir S's user avatar
  • 1
0 votes
1 answer
63 views

Code compares Columns "A" of two workbooks and copies different information to destination workbook with entire selected row. LastRow count slows code

Code explanation: I have a code, which performs two tasks - To open two workbooks, one being extract info and one destination and it compares the column A with Column A of these workbooks and all ...
Rokas's user avatar
  • 3
1 vote
3 answers
211 views

Find numbers whose factors, when squared, sum to a perfect square

I need help optimizing my Python code for CodeWars Integers: Recreation One Kata. We are given a range of numbers and we have to return the number and the sum of the divisors squared that is a square ...
melike's user avatar
  • 47

15 30 50 per page
1 2
3
4 5
71