由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - An interview question from a well-known small company
相关主题
请教一道G家面试题leetcode palindrome number judge cases
leetcode上的Longest Palindromic Substring难道不收brute forT家在线题2道 (转载)
一道有意思的Google面试题24点程序,有人能现场写出来么?
Amazon算法问题请教有人做projecteuler吗?
问个google面试题问道题: numbers of distinct substring
刚刚结束的Yelp电面面经,顺求bless讨论一道所有人做的都不好的lintcode题目
弱弱的问问常出现的让俺糊涂的关于顺序的表述(有包子送)!!!2nd Amazon phone interview (1hr)
报个Pocket gems的onsite题目吧 趁我还记得像准备高考,准备 GRE 一样地准备算法
相关话题的讨论汇总
话题: question话题: palindrome话题: 9009话题: digit话题: known
进入JobHunting版参与讨论
1 (共1页)
C*Y
发帖数: 736
1
I was asked this question in a well-known small company yesterday. We can
prove that, the largest palindrome that are the product of two 2-
digit numbers is 9009 (because 9009 = 99 * 91). Now the question is, how to
find the largest palindrome number that are the product of two 3-digit
numbers?
I just googled this question. All I can found is a brute force algorithm, by
exhaustively testing every number that can be made from the product of two
3-digit
numbers to see if it is a palindrome and rec
l******c
发帖数: 2555
2
99 * 91 = 9009
99x * 91y = 9....9
x * y = 9
so x = y = 3
993 * 913 = 906609
C*Y
发帖数: 736
3
没看懂 :(
能解释一下吗?
为什么因为99 * 91 = 9009,所以答案就能表示成99x * 91y?

【在 l******c 的大作中提到】
: 99 * 91 = 9009
: 99x * 91y = 9....9
: x * y = 9
: so x = y = 3
: 993 * 913 = 906609

l******c
发帖数: 2555
4
that's my solution.
I hope others can give different solutions

【在 C*Y 的大作中提到】
: 没看懂 :(
: 能解释一下吗?
: 为什么因为99 * 91 = 9009,所以答案就能表示成99x * 91y?

C*Y
发帖数: 736
5
当时我用的办法是从乘法表的右下角开始,以从东北方向指向西南方向的斜线一层层的
往左上角平移,也是得到答案906609。不过回家路上回想起来发现这个办法是错误的

【在 l******c 的大作中提到】
: that's my solution.
: I hope others can give different solutions

l******c
发帖数: 2555
6
I don't understand why the company asked this kind of questions.
Any pratical use?

【在 C*Y 的大作中提到】
: 当时我用的办法是从乘法表的右下角开始,以从东北方向指向西南方向的斜线一层层的
: 往左上角平移,也是得到答案906609。不过回家路上回想起来发现这个办法是错误的

1 (共1页)
进入JobHunting版参与讨论
相关主题
像准备高考,准备 GRE 一样地准备算法问个google面试题
Google phone interview questions刚刚结束的Yelp电面面经,顺求bless
做题弱弱的问问常出现的让俺糊涂的关于顺序的表述(有包子送)!!!
急问 OPT I-94 number的位数问题 包子伺候报个Pocket gems的onsite题目吧 趁我还记得
请教一道G家面试题leetcode palindrome number judge cases
leetcode上的Longest Palindromic Substring难道不收brute forT家在线题2道 (转载)
一道有意思的Google面试题24点程序,有人能现场写出来么?
Amazon算法问题请教有人做projecteuler吗?
相关话题的讨论汇总
话题: question话题: palindrome话题: 9009话题: digit话题: known