由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 向各位大侠请教几道面试题的思路
相关主题
一道老题目details 2nd smallest element in an array
请教一道题目问题:Find the minimum number of "swaps" needed to sort an array
liverampOA题目Find the Kth smallest element in 2 sorted
大家看一下这道google面试题一道热门的 Google 面试题
问个google面试题问一道老题
来做一个暴力题Given an array of N integers from range [0, N] and one is missing. Find the missing number.
问两道微软题求教一个onsite面试题目
amazon 电面题问一道google面试题
相关话题的讨论汇总
话题: array话题: given话题: arr话题: element话题: elements
进入JobHunting版参与讨论
1 (共1页)
l********l
发帖数: 91
1
想请教大侠们这几道题的最优解答应该是什么?随便哪题给点思路也好。先说声谢谢了!
1. Given an array of elements, return an array of values pertaining to how
many elements are greater than that element remaining in the array.
Ex. [3,4,5,9,2,1, 3], return [3, 2, 1, 0, 1, 1, 0]
First element is 3 because 3<4,5,9. Second element is 2 because 4< 5,9 etc
2. Given a string which only contains lowercase. You need delete the
repeated letters only leave one, and try to make the lexicographical order
of new string is smallest.
Ex. bcabc
Delete the first 'b' and first 'c', the new string will be abc which is
smallest.
3. Given 2 large number A and B, create a new number C using the digits
from A which needs to be grater than B.
e.g. A = 5281, B = 7443
C = 8125.
4. Given an integer:N and an array int arr[], you have to add some
elements to the array so that you can generate from 1 to N by using
(add) the elements in the array.
Please keep in mind that you can only use each element in the array once
when generating a certain x (1<=x<=N). Return the count of the least adding
numbers.
For example:
N=6, arr = [1, 3]
1 is already in arr.
add 2 to the arr.
3 is already in arr
4 = 1 + 3
5 = 2 + 3
6 = 1 + 2 + 3
So we return 1 since we only need to add one element which is 2.
1 (共1页)
进入JobHunting版参与讨论
相关主题
问一道google面试题问个google面试题
一道面试题来做一个暴力题
贡献两个Amazon的电话面试题问两道微软题
请教一个面试题amazon 电面题
一道老题目details 2nd smallest element in an array
请教一道题目问题:Find the minimum number of "swaps" needed to sort an array
liverampOA题目Find the Kth smallest element in 2 sorted
大家看一下这道google面试题一道热门的 Google 面试题
相关话题的讨论汇总
话题: array话题: given话题: arr话题: element话题: elements