https://programmers.co.kr/learn/courses/30/lessons/42883?language=swift
while (mycount > 0) {
result.removeLast()
mycount -= 1
}
func solution(_ number: String, _ k: Int) -> String {
let numarr = Array(number)
var mycount = k
var result: [Character] = []
for i in 0..<numarr.count {
while (!result.isEmpty && result.last! < numarr[i] && mycount > 0) {
result.removeLast()
mycount -= 1
}
result.append(numarr[i])
}
while (mycount > 0) {
result.removeLast()
mycount -= 1
}
return String(result)
}