diff --git "a/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/README.md" "b/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/README.md" index 7f3a754caf57c..f29879959c9dc 100644 --- "a/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/README.md" +++ "b/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/README.md" @@ -140,6 +140,47 @@ class Solution { } ``` +#### Swift + +```swift +class Solution { + func getTriggerTime(_ increase: [[Int]], _ requirements: [[Int]]) -> [Int] { + let m = increase.count, n = requirements.count + var s = Array(repeating: [0, 0, 0], count: m + 1) + + for i in 0.. Bool { + for i in 0..<3 { + if a[i] < b[i] { + return false + } + } + return true + } +} +``` + diff --git "a/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/Solution.swift" "b/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/Solution.swift" new file mode 100644 index 0000000000000..1b2606567fd06 --- /dev/null +++ "b/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/Solution.swift" @@ -0,0 +1,36 @@ +class Solution { + func getTriggerTime(_ increase: [[Int]], _ requirements: [[Int]]) -> [Int] { + let m = increase.count, n = requirements.count + var s = Array(repeating: [0, 0, 0], count: m + 1) + + for i in 0.. Bool { + for i in 0..<3 { + if a[i] < b[i] { + return false + } + } + return true + } +} \ No newline at end of file