All Questions
Tagged with time-limit-exceeded programming-challenge
505
questions
3
votes
1
answer
152
views
Performance Tuning to enable answer for Project Euler #566 "Cake Icing Puzzle"
Related to this question I am still looking for a solution to Project Euler Problem 566 (see link for a nice simulation also):
Adam plays the following game with his birthday cake.
He cuts a piece ...
4
votes
2
answers
497
views
Leetcode: Steps to Make Array Non-decreasing
I was trying out leetcode's Steps to Make Array Non-decreasing
As per the challenge's description:
You are given a 0-indexed integer array nums. In one step, remove all
elements nums[i] where nums[i ...
9
votes
4
answers
2k
views
Leetcode : First Missing Positive
I was trying out leetcode's first missing positive.
As per the challenge's description:
Given an unsorted integer array nums, return the smallest missing
positive integer.
You must implement an ...
4
votes
2
answers
113
views
Delete a node in binary tree
Problem Statement
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST.
Basically, the deletion ...
2
votes
3
answers
737
views
Find median value of two Sorted Arrays
To improve my coding knowledge can you please give me suggested changes on my code?
...
1
vote
1
answer
87
views
HackerRank Algorithm Problem: Climbing the Leaderboard (Python)
Here is the Hackerrank problem which is related to dense ranking and below is my solution which didn't pass the time limit cases. Any better way to optimize this?
...
3
votes
2
answers
303
views
Trailing Digits
https://www.acmicpc.net/problem/23204
I've solved a programming challenge where you need to count the occurrences of a specific digit at the end of the product of multiples of a given number within a ...
0
votes
1
answer
118
views
HackerRank Project Euler 12 (Python) | Highly Divisible Triangular Numbers
I again share my Python code which didn't pass time limit test cases in the HackerRank contest of ProjectEuler.
...
2
votes
1
answer
108
views
Codeforces: Dasha & Nightmares
so I got started with competitive programming about a day ago and I got stuck on the first random question I tried on codeforces. It's called Dasha and Nightmares.
Problem Description:
The problem ...
0
votes
1
answer
301
views
HackerRank "Digit sum" challenge
Here's the question:
...
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 ...
7
votes
2
answers
1k
views
Find all combinations of length 3 whose sum is divisible by a given number
I came up with a suitable solution to a HackerRank problem that failed because the execution took longer than 10 seconds on lists that were of very large size.
The problem: Given a list ...
6
votes
1
answer
590
views
HackerEarth challenge: Lunch boxes
I was solving the lunch boxes problem on HackerEarth but as I submitted my solution most of the test cases were passed and the rest showed 'Time Limit Exceeded'. I would be very grateful if you could ...
5
votes
1
answer
458
views
Connecting ropes with minimum cost
Question:
There are given N ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. The task is to connect the ropes ...
5
votes
2
answers
980
views
Find the best couple of an array in 1.5 seconds
I faced this exercise.
Given a sequence \$S\$ (\$2 <= |S| <= 10^6\$) of numbers (\$1 <= S_x <= 10^7\$), determine \$max(abs(S_i - S_j) + abs(i -j))\$.
Here is the solution I found:
...