Permalink
Browse files

oops

  • Loading branch information...
ide user ide_egeozcan
ide user ide_egeozcan committed May 15, 2012
1 parent 371268d commit e597bd37f19719d454eb2964a5b238f933a7c6e2
@@ -1,19 +1,22 @@
---
layout: post
category : code
-tags : [javascript, code, time, parsing]
+tags : [javascript, code, project euler]
---
{% include JB/setup %}
-How do you get the minute difference between two 12-hour dates encoded in a
-string?
+Yet another Project Euler problem, solved with rather brute force. I simply
+became too business process oriented to develop clever solutions to mathematical
+problems, maybe? =)
-## Short Answer
+## The Problem
-You shouldn't. Get your data properly!
+Finding the largest palindrome made from the product of two 3-digit numbers.
-## But Still...
+## The Solution
-<script src="https://gist.github.com/2701255.js"> </script>
+<script src="https://gist.github.com/1788749.js"> </script>
-I hate myself.
+Sorry for the lack of elegance. The most interesting thing to learn while coding
+this was finding out that <code>parseInt([x,y,z,z,y,x].join(""))</code> was much
+faster than <code>(x*100001) + (y*10010) + (z*1100)</code> in JavaScript. Hmm.
@@ -1,20 +1,19 @@
----
-layout: post
-category : code
-tags : [javascript, code, project euler]
----
-{% include JB/setup %}
-
-## The Problem
-
-I hate clichés but there we go:
-
-What is the 10 001st prime number?
-
-## The Solution
-
-Let's try a one-liner this time:
-
- var a=[],b;for(b=2;10001>a.length;b++)a.some(function(c){return 0==b%c})||a.push(b);console.log(a.pop());
-
-yay.
+---
+layout: post
+category : code
+tags : [javascript, code, time, parsing]
+---
+{% include JB/setup %}
+
+How do you get the minute difference between two 12-hour dates encoded in a
+string?
+
+## Short Answer
+
+You shouldn't. Get your data properly!
+
+## But Still...
+
+<script src="https://gist.github.com/2701255.js"> </script>
+
+I hate myself.

0 comments on commit e597bd3

Please sign in to comment.