Tagged Questions
7
votes
2answers
90 views
TapeEquilibrium implementation does not satisfy all requirements
The Codility's TapeEquilibrium problem asks:
Given an array \$A\$ with length \$N\$, indexed starting from 0, find an equilibrium index \$P\$, such that
$$\left| \sum_{i=0}^{P-1} a_i - ...
10
votes
1answer
148 views
Tweets per second, using linked list
This is a TalentBuddy Challenge
Your task is to
write a function that prints to the standard output (stdout) the highest number of tweets recorded between each second in the array and the past ...
6
votes
2answers
438 views
Stable custom alphabetical order using List<T>.Sort
Background
This is a problem from a programming contest.
The Sharonians of planet Sharon, at the far end of our galaxy, have
discovered various samples of English text from our electronic
...
3
votes
2answers
984 views
What is the 10001st prime number?
Project Euler problem 7 says:
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10001st prime number?
I believe that my code is ...
5
votes
4answers
337 views
Alternative to a large switch
Wanted to consolidate solutions to disparate problems into a single program.
I am worried that there is a interface, command pattern, or dictionary solution to what will become a massive switch ...
1
vote
2answers
293 views
Project Euler: Problem 13 - Large Sum
I've written some code to solve this problem:
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
My solution functions correctly, but I'm having some trouble ...
0
votes
2answers
109 views
Code optimization for euler's problem 28
I have found the solution for euler's problem using recursion.Is it okay or is there any other way to optimize the code?
...
2
votes
1answer
231 views
Project Euler #13 efficiency
Okay, so I finally tackled #13 from Project Euler. I'm said to announce it took me almost 2 hours to come up with this solution, after about an hour of thinking on how to do it.
Here's what I did:
...
3
votes
1answer
144 views
Truncating an integer from left to right and right to left
Project Euler problem 37 says:
The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: ...
3
votes
1answer
98 views
Quadratic Primes
This is one of the slightly trickier Project Euler Questions I have seen (Question 27)
...
4
votes
4answers
616 views
Sum of primes less than 2,000,000
I have been attempting the questions at Project Euler and I am trying to find the sum of Primes under two million (question 10)
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the ...
5
votes
1answer
566 views
smallest number divisible by all numbers from 1 to 20? Project Euler question 5
I'm currently working my way through the questions on Project Euler and I am on question 5. Is this the best possible solution? Any suggestions welcomed!
...
4
votes
2answers
386 views
Another iteration of Alien Language
I'm mostly looking for performance suggestions. Feel free to include more than just that.
Since Google Code Jam is coming around, I thought I would look at some of the previous questions. Alien ...
1
vote
1answer
510 views
Connect graph from 2d array
I just completed project euler problem 18 which is a dynamic programming question through a graph of a triangle of numbers. The goal is to find the path from top to bottom of the triangle that has the ...
3
votes
6answers
4k views
Find the largest Prime Factor of the number 600851475143
I am trying to complete this challenge, which is to find the Find the largest Prime Factor of the number 600851475143.
My current solution is below:
...
2
votes
2answers
448 views
Calculation of the distance to the next space station
I've made a solution for this problem:
Task:
Write a program for calculation of the distance to the next space station.
Algorithm:
First base is located at the distance equal to
...
8
votes
6answers
1k views
Determining numeric palindromes
I am working on bettering my C# skills, and recently wrote this program to solve a projecteuler.net problem:
A palindromic number reads the same both ways. The largest palindrome
made from the ...