diff --git "a/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/README.md" "b/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/README.md" index 4e21105c919d4..1b44a5d0836b8 100644 --- "a/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/README.md" +++ "b/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/README.md" @@ -235,6 +235,57 @@ function maxmiumScore(cards: number[], cnt: number): number { } ``` +#### Swift + +```swift +class Solution { + func maximumScore(_ cards: [Int], _ cnt: Int) -> Int { + let sortedCards = cards.sorted() + let n = sortedCards.count + var ans = 0 + + for i in 0..= 0 ? maxScore : 0 + } +} +``` + diff --git "a/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/Solution.swift" "b/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/Solution.swift" new file mode 100644 index 0000000000000..767c90eeef9df --- /dev/null +++ "b/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/Solution.swift" @@ -0,0 +1,46 @@ +class Solution { + func maximumScore(_ cards: [Int], _ cnt: Int) -> Int { + let sortedCards = cards.sorted() + let n = sortedCards.count + var ans = 0 + + for i in 0..= 0 ? maxScore : 0 + } +}