func climbingLeaderboard(ranked: [Int], player: [Int]) -> [Int] {
var scores: [Int] = []
let countOfRanked: Int = ranked.count
var i: Int = 0
while i < countOfRanked {
let current = ranked[i]
scores.append(current)
while i < countOfRanked && current == ranked[i] {
i += 1
}
}
let n = scores.count
var answer: [Int] = []
i = 0
for score in player {
while i < n && scores[n-i-1] <= score {
i += 1
}
answer.append(n-i+1)
}
return answer
}