注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
面试原题,请大家加大米支持,会发更多题目,谢谢
1.
You have a deck of cards numbered from 1 to n where n is the total number of cards. The cards are currently arranged in some order, and you want to sort them in ascending order (1, 2, 3, ..., n).
The only operation you can perform is a shuffle move: take k cards from the top of the deck and move them to the bottom, where k is any integer from to n-1.
Given a deck of esented in the larger matrix mat
Return the updated matrix mat as a result.
Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(n ^ 2) will fit within the execution time limit.
|