Hot startup coding test 的问题# JobHunting - 待字闺中
j*r
1 楼
一家hot startup,coding question:
Write a function that takes two parameters: (1) a String representing a text
document and (2) an integer providing the number of items to return.
Implement the function such that it returns a list of Strings ordered by
word frequency, the most frequently occurring word first. Use your best
judgement to decide how words are separated. Your solution should run in O(n
) time where n is the number of characters in the document. Implement this
function as you would for a production/commercial system. You may use any
standard data structures.
有什么好的解法吗?
Write a function that takes two parameters: (1) a String representing a text
document and (2) an integer providing the number of items to return.
Implement the function such that it returns a list of Strings ordered by
word frequency, the most frequently occurring word first. Use your best
judgement to decide how words are separated. Your solution should run in O(n
) time where n is the number of characters in the document. Implement this
function as you would for a production/commercial system. You may use any
standard data structures.
有什么好的解法吗?