Coding Challenge 2

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
Chrajdal
Posts: 22
Joined: December 15th, 2012, 2:18 pm

Re: Coding Challenge 2

Post by Chrajdal » September 17th, 2017, 1:11 pm

Fonduee wrote:
Chrajdal wrote:
Fonduee wrote:Hi, guys, can you reveal your execution times, i want to compare with mine xD
You first! :D
:lol:, about 16-20 ms.
Good job! I'm currently around 650ms for the number Chilli gave us. I've tried with 10 000 digits long number and resulted in 1,2 seconds :) if I get some more time on my hands I will look into optimization.

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Coding Challenge 2

Post by Yumtard » September 17th, 2017, 5:27 pm

How do you guys measure? in debug or release?

User avatar
Chrajdal
Posts: 22
Joined: December 15th, 2012, 2:18 pm

Re: Coding Challenge 2

Post by Chrajdal » September 17th, 2017, 6:26 pm

Yumtard wrote:How do you guys measure? in debug or release?
In release.

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Coding Challenge 2

Post by Yumtard » September 17th, 2017, 6:47 pm

ok. then im at like 250-300ms. started out at 650-700ms. no idea how fonduee does it in 16-20 :D

User avatar
Fonduee
Posts: 3
Joined: August 30th, 2017, 6:21 pm

Re: Coding Challenge 2

Post by Fonduee » September 17th, 2017, 6:55 pm

Yumtard wrote:ok. then im at like 250-300ms. started out at 650-700ms. no idea how fonduee does it in 16-20 :D
oh, crap, my solution was wrong, Chili confirmed it :roll:

User avatar
Chrajdal
Posts: 22
Joined: December 15th, 2012, 2:18 pm

Re: Coding Challenge 2

Post by Chrajdal » September 17th, 2017, 7:38 pm

Fonduee wrote:
Yumtard wrote:ok. then im at like 250-300ms. started out at 650-700ms. no idea how fonduee does it in 16-20 :D
oh, crap, my solution was wrong, Chili confirmed it :roll:

Hopefully Chilli won't mind me giving you some test numbers so that you can be sure that you are sending correct solution.

For this number:
"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
is the solution: 436
And for the number in the attachment it is: 4421

Hopefully the numbers are correct :D

Cheers.
Attachments
1000digits.txt
(1000 Bytes) Downloaded 170 times

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Coding Challenge 2

Post by Yumtard » September 17th, 2017, 7:49 pm

^ Yup (Y)

User avatar
MyK_00L
Posts: 19
Joined: June 21st, 2016, 10:44 am

Re: Coding Challenge 2

Post by MyK_00L » September 18th, 2017, 1:00 pm

Well, the execution time does depend on the pc you are running it on ad on the compiler settings you are using, so I'm not sure how useful comparing like this would be.
Anyways my code runs in about 1.3 seconds.
I hope Chili will show us the execution times of the best codes with the solution vid.
I'm not gonna say the complexity of my algorithm, because it could spoil the solution, but I think that would be a good way of comparing programs by efficiency.

User avatar
Chrajdal
Posts: 22
Joined: December 15th, 2012, 2:18 pm

Re: Coding Challenge 2

Post by Chrajdal » September 18th, 2017, 2:19 pm

MyK_00L wrote:Well, the execution time does depend on the pc you are running it on ad on the compiler settings you are using, so I'm not sure how useful comparing like this would be.
Anyways my code runs in about 1.3 seconds.
I hope Chili will show us the execution times of the best codes with the solution vid.
I'm not gonna say the complexity of my algorithm, because it could spoil the solution, but I think that would be a good way of comparing programs by efficiency.
You are absolutely right!

Another way of comparing might be trying to compute bigger numbers (say 100 000 digits, or more?) Which could tell us more about the complexity growth of each program, and therefore point us to a potential winner.

User avatar
MyK_00L
Posts: 19
Joined: June 21st, 2016, 10:44 am

Re: Coding Challenge 2

Post by MyK_00L » September 18th, 2017, 3:15 pm

I was on the Discord and Chili said how fast his solution was...
I have mixed feelings...
He said it was 670 microseconds.

Post Reply