Jump to content

Hello, Hi, Hey: I'm $$$ richh


Recommended Posts

oh cool palindrome next page

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.

Find the largest palindrome made from the product of two 3-digit numbers.

This took me ages.

Link to comment
Share on other sites

  • Replies 493.9k
  • Created
  • Last Reply

Top Posters In This Topic

  • Starman

    60032

  • Kinumi

    38629

  • Lance Masayoshi

    26279

  • Soledai

    25884

Woah why you call me silly

A bunch of reasons actually that I highly doubt anyone here wants to hear

Wait what

Are you trying to argue that you can find no reason to make reasons or that you can't find no reason to make reasons??

Because I was arguing that of course you could find no reason to make reasons

Edited by Freohr Datia
Link to comment
Share on other sites

Wait what

Are you trying to argue that you can find no reason to make reasons or that you can't find no reason to make reasons??

Because I was arguing that of course you could find no reason to make reasons

I just confuse myself too much

I'm trying to say I can see no reason to make reasons to exist

Link to comment
Share on other sites

My solution was...

var a = 999;
var b = a;
var c = 0;

var isPalindrome = function(n) {
	var mirror = String(n).split("").reverse().join("");
	return (String(n) === mirror);
}

while (a > 99) {
	if (isPalindrome(a * b) && a * b > c) {
		c = a * b;
	}
	
	if (b > 99) {
		b--;
	} else {
		b = --a;
	}
}

c;
I'm still not sure how I could slim down the clock cycles... Edited by Makaze
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...