Tagged Questions
11
votes
3answers
858 views
The Love-Letter Mystery
Problem Statement
James got hold of a love letter that his friend Harry has written for
his girlfriend. Being the prankster that James is, he decides to
meddle with it. He changes all the ...
10
votes
1answer
289 views
x64 Assembly - checking for largest prime factor
Using x64 assembly, I solved the Largest Prime Factor problem on Project Euler.
The problem is as follows:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of ...
7
votes
4answers
612 views
Finding the sum of all the multiples of 3 or 5 below 1000, using list comprehension
I'm trying to compare my own implementation with another solution of Project Euler problem #1, which uses a list comprehension:
...
6
votes
2answers
209 views
Largest product in a grid
Project Euler problem 11 says:
In the 20×20 grid below, four numbers along a diagonal line have been marked in bold. [red in the original]
...
6
votes
4answers
727 views
Finding the Pythagorean triplet that sums to 1000
Project Euler problem 9 says:
A Pythagorean triplet is a set of three natural numbers, a < b < c,
for which,
a2 + b2 = c2
For example, 32 + 42 = 9 + 16 = 25 = 52.
There ...
5
votes
2answers
2k views
Finding the most common character in a string
I have started to try and work out the TopCoder problems. The "StringDup" problem asks us to:
Create a class called StringDup. Given a string made up of ONLY letters and
digits, determine which ...
5
votes
3answers
3k views
Python Solution for Project Euler #2 (Fibonacci Sums)
I'm a fairly new programmer (just started yesterday!). I decided to tackle Project Euler #2 today, as I did #1 yesterday without many problems. I came up with what seems to me to be a working ...
5
votes
2answers
568 views
Golang solution to Project Euler #81 (min path through a matrix)
Project Euler problem 81 asks:
In the 5 by 5 matrix below,
...
4
votes
4answers
102 views
Project Euler 1 (sum of multiples of 3 or 5 under 1000)
I solved this a while ago. In the moment I solved it I was learning Scheme and, well, I still am. I'm not looking at the best solution (I searched for it and coded it already, in Python), what I want ...
4
votes
1answer
53 views
Project Euler Problem 1 - Multiples of 3 and 5
I wrote this function for Project Euler Problem 1.
...
3
votes
3answers
113 views
Login script that checks two users and their corresponding passwords
Please let me know what you think. Is the code well written? Am I using best practices (like when I chose === over ==)? Is my ...
3
votes
1answer
427 views
Decoding binary string message
I am trying to learn some Java on my own, and I am tackling some "programming challenge" problems to practice the little I have learnt so far.
Could anybody constructively critique this beginner's ...
3
votes
1answer
43 views
Adding reversed numbers
This is my solution to the competitive coding question on SPOJ here. It gives a runtime of 0.24 but the best solutions posted have a 0.0 runtime. How could I possibly achieve better results than ...
1
vote
6answers
1k views
The Next Palindrome - reducing total execution time
I tried to solve one SPOJ problem. I wrote one program in Python, however, it got accepted by the SPOJ judges, but its total execution time is 2.88s. The same algorithm used in C language having ...
1
vote
1answer
71 views
Square free Integer
I am an amateur programmer and I tried coding this problem using the TurboC++ IDE (though my code is in C), but the site's compiler throws a "TIME LIMIT EXCEEDED" error. How can I optimize my code ...