请教,只有一个娃有什么不好吗# Parenting - 为人父母
r*g
1 楼
hi
考古发现以前题似乎更难一些,不知道是不是错觉
1,从一个string 变到另一个,比如"study"->"world" (字数相等),要求
每次变一个字母,每次改变后的string必须是一个词典里面能查到的英语单词,比如你
不能把study变
成atudy
由于加了个条件,不知道最后讨论出来什么办法更好,似乎还是没有定论?
2, Given an integer, print the closest number to it that is a palindrome
input: 1224
return: 1221.
这个题仔细一想一点都不简单,关键是,最closet的数可能和原来的数完全不一样,怎
么弄?
3, In our indexes, we have millions of URLs each of which has a link to the
page content, now, suppose a user type a query with wild cards *, which
represent 0 or multiple occcurrences of any characters, how to build the
index such that such a type of query can be executed efficiently and the
contents of all correpsonding URLs can be displayed to the users? For
example, given a query http://www.*o*ve*ou.com. You man need to find iloveyou.com, itveabcu.com, etc.
这个题,不是拿pattern去匹配一个wildcarded单词,而是总体的,感觉很不容易想。
4,Given a 3x3 square:
1 2 3
4 5 6
7 8 9
You are allowed to do circular shift on any row, and
circular shift on any column, as many times as you
please. Question: can you switch position of 1 and 2 with
the allowed circular shifts?
这个不就是魔方么。。。原来还有算法的。。。
5, Given an array, find the longest subarray which the sum of the subarray
less or equal then the given MaxSum.
int[] FindMaxSumArray(int[] array, int maxsum)
for example, given array: {1, -2, 4, 5, -2, 6, 7}
maxsum=7
the result would be: {1,-2, 4, -2, 6}
貌似是max sum subarry的变型,但是显然不是那个思路,一下子没想起来。
多谢。
考古发现以前题似乎更难一些,不知道是不是错觉
1,从一个string 变到另一个,比如"study"->"world" (字数相等),要求
每次变一个字母,每次改变后的string必须是一个词典里面能查到的英语单词,比如你
不能把study变
成atudy
由于加了个条件,不知道最后讨论出来什么办法更好,似乎还是没有定论?
2, Given an integer, print the closest number to it that is a palindrome
input: 1224
return: 1221.
这个题仔细一想一点都不简单,关键是,最closet的数可能和原来的数完全不一样,怎
么弄?
3, In our indexes, we have millions of URLs each of which has a link to the
page content, now, suppose a user type a query with wild cards *, which
represent 0 or multiple occcurrences of any characters, how to build the
index such that such a type of query can be executed efficiently and the
contents of all correpsonding URLs can be displayed to the users? For
example, given a query http://www.*o*ve*ou.com. You man need to find iloveyou.com, itveabcu.com, etc.
这个题,不是拿pattern去匹配一个wildcarded单词,而是总体的,感觉很不容易想。
4,Given a 3x3 square:
1 2 3
4 5 6
7 8 9
You are allowed to do circular shift on any row, and
circular shift on any column, as many times as you
please. Question: can you switch position of 1 and 2 with
the allowed circular shifts?
这个不就是魔方么。。。原来还有算法的。。。
5, Given an array, find the longest subarray which the sum of the subarray
less or equal then the given MaxSum.
int[] FindMaxSumArray(int[] array, int maxsum)
for example, given array: {1, -2, 4, 5, -2, 6, 7}
maxsum=7
the result would be: {1,-2, 4, -2, 6}
貌似是max sum subarry的变型,但是显然不是那个思路,一下子没想起来。
多谢。