题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1718 Rank Description Jackson wants to know his rank in the class. The professor has posted a list of student numbers and marks. Compute Jackson’s rank in class; that is, if he has the top mark(or is tie…
Problem Description Jackson wants to know his rank in the class. The professor has posted a list of student numbers and marks. Compute Jackson's rank in class; that is, if he has the top mark(or is tied for the top mark) his rank is 1; if he has the…
Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in \(O(n)\) time and uses constant space. 若数组为[10,20,30], 则返回0+1 = 1, 因为 A[0]!=( 0 + 1 )…