port overlort python ->Swift assed edition!

fukurou

the supreme coder
ADMIN
Swift:
// ╔════════════════════════════════════════════════════════════════════════╗
// ║ TABLE OF CONTENTS                                                      ║
// ╠════════════════════════════════════════════════════════════════════════╣
// ║ 1. STRING CONVERTERS                                                   ║
// ║ 2. UTILITY                                                             ║
// ║ 3. TRIGGERS                                                            ║
// ║ 4. SPECIAL SKILLS DEPENDENCIES                                         ║
// ║ 5. SPEECH ENGINES                                                      ║
// ║ 6. OUTPUT MANAGEMENT                                                   ║
// ║ 7. LEARNABILITY                                                        ║
// ║ 8. MISCELLANEOUS                                                       ║
// ║ 9. UNDER USE                                                           ║
// ╚════════════════════════════════════════════════════════════════════════╝

// ╔══════════════════════════════════════════════════════════════════════╗
// ║     📜 TABLE OF CONTENTS — CLASS INDEX                               ║
// ╚══════════════════════════════════════════════════════════════════════╝

// ┌────────────────────────────┐
// │ 🧵 STRING CONVERTERS       │
// └────────────────────────────┘
// - AXFunnel
// - AXLMorseCode
// - AXLNeuroSama
// - AXStringSplit
// - PhraseInflector

// ┌────────────────────────────┐
// │ 🛠️ UTILITY                 │
// └────────────────────────────┘
// - TimeUtils
// - LGPointInt
// - LGPointFloat
// - enumRegexGrimoire
// - RegexUtil
// - CityMap
// - CityMapWithPublicTransport

// ┌────────────────────────────┐
// │ 🎯 TRIGGERS                │
// └────────────────────────────┘
// - CodeParser
// - TimeGate
// - LGFIFO
// - UniqueItemsPriorityQue
// - UniqueItemSizeLimitedPriorityQueue
// - RefreshQ
// - AnnoyedQ
// - TrgTolerance
// - AXCmdBreaker
// - AXContextCmd
// - AXInputWaiter
// - LGTypeConverter
// - DrawRnd
// - AXPassword
// - TrgTime
// - Cron
// - AXStandBy
// - Cycler
// - OnOffSwitch
// - TimeAccumulator
// - KeyWords
// - QuestionChecker
// - TrgMinute
// - TrgEveryNMinutes

// ┌──────────────────────────────────────────────┐
// │ 🧪 SPECIAL SKILLS DEPENDENCIES               │
// └──────────────────────────────────────────────┘
// - TimedMessages
// - AXLearnability
// - AlgorithmV2
// - SkillHubAlgDispenser
// - UniqueRandomGenerator
// - UniqueResponder
// - AXSkillBundle
// - AXGamification
// - Responder

// ┌────────────────────────────┐
// │ 🗣️ SPEECH ENGINES          │
// └────────────────────────────┘
// - ChatBot
// - ElizaDeducer
// - PhraseMatcher
// - ElizaDeducerInitializer (ElizaDeducer)
// - ElizaDBWrapper
// - RailBot
// - EventChat
// - AXFunnelResponder
// - TrgParrot

// ┌────────────────────────────┐
// │ 🎛️ OUTPUT MANAGEMENT       │
// └────────────────────────────┘
// - LimUniqueResponder
// - EventChatV2
// - PercentDripper
// - AXTimeContextResponder
// - Magic8Ball
// - Responder1Word

// ┌────────────────────────────┐
// │ 🧩 STATE MANAGEMENT        │
// └────────────────────────────┘
// - Prompt
// - AXPrompt
// - AXMachineCode
// - ButtonEngager
// - AXShoutOut
// - AXHandshake
// - Differ
// - ChangeDetector

// ┌────────────────────────────┐
// │ 🧠 LEARNABILITY            │
// └────────────────────────────┘
// - SpiderSense
// - Strategy
// - Notes
// - Catche

// ┌────────────────────────────┐
// │ 🧿 MISCELLANEOUS           │
// └────────────────────────────┘
// - AXKeyValuePair
// - CombinatoricalUtils
// - AXNightRider
 

fukurou

the supreme coder
ADMIN
Swift:
class AXFunnel {
    // Funnel all sorts of strings to fewer or other strings (•‿•)

    private var dic: [String: String] = [:]
    private var defaultValue: String

    init(_ defaultValue: String = "default") {
        self.defaultValue = defaultValue
    }

    func setDefault(_ defaultValue: String) {
        self.defaultValue = defaultValue
    }

    @discardableResult
    func addKV(_ key: String, _ value: String) -> AXFunnel {
        dic[key] = value
        return self
    }

    @discardableResult
    func addK(_ key: String) -> AXFunnel {
        dic[key] = defaultValue
        return self
    }

    func funnel(_ key: String) -> String {
        return dic[key] ?? key
    }

    func funnel_or_empty(_ key: String) -> String {
        return dic[key] ?? ""
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class AXLMorseCode {
    // A happy little Morse Code converter~! (◕‿◕✿)

    private let morseDict: [Character: String] = [
        "A": ".-",    "B": "-...",  "C": "-.-.",  "D": "-..",
        "E": ".",     "F": "..-.",  "G": "--.",   "H": "....",
        "I": "..",    "J": ".---",  "K": "-.-",   "L": ".-..",
        "M": "--",    "N": "-.",    "O": "---",   "P": ".--.",
        "Q": "--.-",  "R": ".-.",   "S": "...",   "T": "-",
        "U": "..-",   "V": "...-",  "W": ".--",   "X": "-..-",
        "Y": "-.--",  "Z": "--..",
        "0": "-----", "1": ".----", "2": "..---", "3": "...--",
        "4": "....-", "5": ".....", "6": "-....", "7": "--...",
        "8": "---..", "9": "----.",
        " ": "/"
    ]

    private lazy var reverseMorse: [String: Character] = {
        var reverse = [String: Character]()
        for (key, value) in morseDict {
            reverse[value] = key
        }
        return reverse
    }()

    func morse(_ text: String) -> String {
        // Converts text to Morse code! (◠‿◠)
        let upper = text.uppercased()
        let result = upper.compactMap { morseDict[$0] }
        return result.joined(separator: " ")
    }

    func demorse(_ morseCode: String) -> String {
        // Converts Morse code back to text! (ノ◕ヮ◕)ノ*:・゚✧
        let tokens = morseCode.split(separator: " ")
        let result = tokens.compactMap { reverseMorse[String($0)] }
        return String(result)
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class AXNeuroSama {
    // The higher the rate, the less likely to decorate outputs (◕‿◕✿)
    private let _rate: Int
    private let _nyaa: Responder
    private let _rnd: DrawRnd

    init(_ rate: Int) {
        self._rate = rate
        self._nyaa = Responder(" heart", " heart", " wink", " heart heart heart")
        self._rnd = DrawRnd()
    }

    func decorate(_ output: String) -> String {
        guard !output.isEmpty else { return output }
        if _rnd.getSimpleRNDNum(_rate) == 0 {
            return output + _nyaa.getAResponse()
        }
        return output
    }
}

class AXLHousing {
    // Override me
    func decorate(_ str1: String) -> String {
        return ""
    }
}

class AXLNeuroSama: AXLHousing {
    private let _nyaa: AXNeuroSama

    override init() {
        self._nyaa = AXNeuroSama(3)
        super.init()
    }

    override func decorate(_ str1: String) -> String {
        return _nyaa.decorate(str1)
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class AXStringSplit {
    // May be used to prepare data before saving or after loading
    // The advantage is fewer data fields (e.g., {skills: s1_s2_s3}) ✨

    private var _separator: String = "_"

    func setSeparator(_ separator: String) {
        self._separator = separator
    }

    func split(_ str1: String) -> [String] {
        return str1.components(separatedBy: _separator)
    }

    func stringBuilder(_ l1: [String]) -> String {
        return l1.joined(separator: _separator)
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class PhraseInflector {
    // Maps for pronoun and verb inflection ⚙️

    static let inflectionMap: [String: String] = [
        "i": "you", "me": "you", "my": "your", "mine": "yours",
        "you": "i", "your": "my", "yours": "mine",
        "am": "are", "are": "am", "was": "were", "were": "was",
        "i'd": "you would", "i've": "you have", "you've": "I have", "you'll": "I will"
    ]

    static func isVerb(_ word: String) -> Bool {
        let verbs: Set<String> = ["am", "are", "was", "were", "have", "has", "had", "do", "does", "did"]
        return verbs.contains(word)
    }

    static func inflectPhrase(_ phrase: String) -> String {
        let words = phrase.split(separator: " ").map(String.init)
        var result: [String] = []

        for (i, word) in words.enumerated() {
            let lowerWord = word.lowercased()
            var inflectedWord = word

            if let mapped = inflectionMap[lowerWord] {
                inflectedWord = mapped

                if lowerWord == "you" {
                    if i == words.count - 1 || (i > 0 && isVerb(words[i - 1].lowercased())) {
                        inflectedWord = "me"
                    } else {
                        inflectedWord = "I"
                    }
                }
            }

            // Preserve capitalization
            if let first = word.first, first.isUppercase {
                inflectedWord = inflectedWord.prefix(1).capitalized + inflectedWord.dropFirst()
            }

            result.append(inflectedWord)
        }

        return result.joined(separator: " ")
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class LGPointInt: CustomStringConvertible {
    private(set) var x: Int
    private(set) var y: Int

    init(_ x_init: Int, _ y_init: Int) {
        self.x = x_init
        self.y = y_init
    }

    func shift(_ x: Int, _ y: Int) {
        self.x += x
        self.y += y
    }

    func setPosition(_ x: Int, _ y: Int) {
        self.x = x
        self.y = y
    }

    func reset() {
        self.x = 0
        self.y = 0
    }

    var description: String {
        return "Point(\(x),\(y))"
    }
}

func distance(_ a: LGPointInt, _ b: LGPointInt) -> Double {
    let dx = Double(a.x - b.x)
    let dy = Double(a.y - b.y)
    return (dx * dx + dy * dy).squareRoot()
}

class LGPointFloat: CustomStringConvertible {
    private(set) var x: Double
    private(set) var y: Double

    init(_ x_init: Double, _ y_init: Double) {
        self.x = x_init
        self.y = y_init
    }

    func shift(_ x: Double, _ y: Double) {
        self.x += x
        self.y += y
    }

    var description: String {
        return "Point(\(x),\(y))"
    }

    static func distance(_ a: LGPointFloat, _ b: LGPointFloat) -> Double {
        let dx = a.x - b.x
        let dy = a.y - b.y
        return (dx * dx + dy * dy).squareRoot()
    }
}
 

fukurou

the supreme coder
ADMIN
new ver:

Swift:
class RegexUtil {
    static func extractRegex(_ theRegex: String, _ str2Check: String) -> String {
        if let match = str2Check.range(of: theRegex, options: .regularExpression) {
            return String(str2Check[match]).trimmingCharacters(in: .whitespaces)
        }
        return ""
    }

    static func extractEnumRegex(_ theRegex: RegexGrimoire, _ str2Check: String) -> String {
        return extractRegex(theRegex.rawValue, str2Check)
    }

    static func extractAllRegexes(_ theRegex: String, _ str2Check: String) -> [String] {
        let regex = try? NSRegularExpression(pattern: theRegex)
        let range = NSRange(str2Check.startIndex..., in: str2Check)
        return regex?.matches(in: str2Check, range: range).compactMap {
            Range($0.range, in: str2Check).map { String(str2Check[$0]) }
        } ?? []
    }

    static func extractAllEnumRegexes(_ theRegex: RegexGrimoire, _ str2Check: String) -> [String] {
        return extractAllRegexes(theRegex.rawValue, str2Check)
    }

    static func pointRegex(_ str2Check: String) -> LGPointInt {
        let intPattern = RegexGrimoire.integer.rawValue
        var result = LGPointInt(0, 0)
        if let match = str2Check.range(of: intPattern, options: .regularExpression) {
            let yStr = String(str2Check[match]).trimmingCharacters(in: .whitespaces)
            result.y = Int(yStr) ?? 0
            let indexAfterY = str2Check.index(match.upperBound, offsetBy: 1, limitedBy: str2Check.endIndex) ?? str2Check.endIndex
            let phase2 = String(str2Check[indexAfterY...])
            let xStr = extractEnumRegex(.integer, phase2)
            if let xInt = Int(xStr) {
                result.x = xInt
            }
        }
        return result
    }

    static func afterWord(_ word: String, _ str2Check: String) -> String {
        let regexPattern = "(?<=" + NSRegularExpression.escapedPattern(for: word) + ")(.*)"
        return extractRegex(regexPattern, str2Check)
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class CityMap {
    private var streets: [String: [String]] = [:]
    private var maxConnections: Int
    private var lastInp: String = "standby"

    init(_ n: Int) {
        self.maxConnections = n
    }

    func add_street(_ current_street: String, _ new_street: String) {
        guard !new_street.isEmpty else { return }

        if streets[current_street] == nil {
            streets[current_street] = []
        }
        if streets[new_street] == nil {
            streets[new_street] = []
        }

        appendWithLimit(&streets[current_street]!, new_street)
        appendWithLimit(&streets[new_street]!, current_street)
    }

    func add_streets_from_string(_ current_street: String, _ streets_string: String) {
        let parts = streets_string.split(separator: "_").map(String.init)
        for street in parts {
            add_street(current_street, street)
        }
    }

    func learn(_ inp: String) {
        guard inp != lastInp else { return }
        add_street(lastInp, inp)
        lastInp = inp
    }

    func find_path(_ start_street: String, _ goal_street: String, _ avoid_street: String, _ max_length: Int = 4) -> [String] {
        guard let _ = streets[start_street] else { return [] }

        var queue: [(String, [String])] = [(start_street, [start_street])]
        var visited: Set<String> = [start_street]

        while !queue.isEmpty {
            let (current, path) = queue.removeFirst()
            if path.count > max_length { return [] }
            if current == goal_street { return path }

            for neighbor in streets[current]! where !visited.contains(neighbor) && neighbor != avoid_street {
                queue.append((neighbor, path + [neighbor]))
                visited.insert(neighbor)
            }
        }
        return []
    }

    func get_random_street(_ current_street: String) -> String {
        if let options = streets[current_street], !options.isEmpty {
            return options.randomElement() ?? ""
        }
        return ""
    }

    func get_streets_string(_ street: String) -> String {
        return streets[street]?.joined(separator: "_") ?? ""
    }

    func get_first_street(_ current_street: String) -> String {
        return streets[current_street]?.first ?? ""
    }

    static func create_city_map_from_path(_ path: [String]) -> CityMap {
        let newMap = CityMap(1)
        for i in 0..<(path.count - 1) {
            newMap.add_street(path[i], path[i + 1])
        }
        return newMap
    }

    func find_path_with_must(_ start: String, _ goal: String, _ street_must: String, _ max_length: Int = 4) -> [String] {
        guard streets[start] != nil, streets[goal] != nil, streets[street_must] != nil else { return [] }

        let toMust = find_path(start, street_must, "", max_length)
        if toMust.isEmpty { return [] }

        let fromMust = find_path(street_must, goal, "", max_length)
        if fromMust.isEmpty { return [] }

        return toMust + fromMust.dropFirst()
    }

    // Helper: emulate max-length deque behavior
    private func appendWithLimit(_ list: inout [String], _ newElement: String) {
        if list.count == maxConnections {
            list.removeFirst()
        }
        list.append(newElement)
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class CityMapWithPublicTransport {
    private var streets: [String: [String]] = [:]
    private var transportLines: [String: [String]] = [:]
    private var maxConnections: Int
    private var lastInp: String = "standby"

    init(_ n: Int) {
        self.maxConnections = n
    }

    func add_street(_ current_street: String, _ new_street: String) {
        if streets[current_street] == nil {
            streets[current_street] = []
        }
        if streets[new_street] == nil {
            streets[new_street] = []
        }
        appendWithLimit(&streets[current_street]!, new_street)
        appendWithLimit(&streets[new_street]!, current_street)
    }

    func add_transport_line(_ line_name: String, _ stops: [String]) {
        transportLines[line_name] = stops
        for i in 0..<(stops.count - 1) {
            add_street(stops[i], stops[i + 1])
        }
    }

    func find_path(
        _ start: String,
        _ goal: String,
        _ avoid: String? = nil,
        _ max_length: Int = 4,
        _ use_transport: Bool = true
    ) -> [String] {
        var queue: [(String, [String], String)] = [(start, [start], "walk")]
        var visited: Set<String> = [ "\(start)|walk" ]

        while !queue.isEmpty {
            let (current, path, mode) = queue.removeFirst()

            if path.count > max_length { continue }
            if current == goal { return path }

            for neighbor in streets[current] ?? [] {
                if neighbor == avoid { continue }
                let key = "\(neighbor)|walk"
                if !visited.contains(key) {
                    visited.insert(key)
                    queue.append((neighbor, path + [neighbor], "walk"))
                }
            }

            if use_transport {
                for (line, stops) in transportLines {
                    guard let idx = stops.firstIndex(of: current) else { continue }

                    if idx + 1 < stops.count {
                        let next = stops[idx + 1]
                        let key = "\(next)|\(line)"
                        if !visited.contains(key) {
                            visited.insert(key)
                            queue.append((next, path + [next], line))
                        }
                    }
                    if idx > 0 {
                        let prev = stops[idx - 1]
                        let key = "\(prev)|\(line)"
                        if !visited.contains(key) {
                            visited.insert(key)
                            queue.append((prev, path + [prev], line))
                        }
                    }
                }
            }
        }

        return []
    }

    private func appendWithLimit(_ list: inout [String], _ newElement: String) {
        if list.count == maxConnections {
            list.removeFirst()
        }
        list.append(newElement)
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
// ╔════════════════════════════════════════════════════════════════════════╗
// ║                               TRIGGERS                                 ║
// ╚════════════════════════════════════════════════════════════════════════╝
 

fukurou

the supreme coder
ADMIN
Swift:
class CodeParser {
    static func extract_code_number(_ s: String) -> Int {
        let pattern = #"^code (\d+)$"#
        if let regex = try? NSRegularExpression(pattern: pattern) {
            let range = NSRange(s.startIndex..., in: s)
            if let match = regex.firstMatch(in: s, range: range),
               let numRange = Range(match.range(at: 1), in: s) {
                return Int(s[numRange]) ?? -1
            }
        }
        return -1
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class TimeGate{
    //time boolean gate
    // gate goes open (pause minutes time)-> closed
    private var pause:Int = 5
    private var openDate:Date = Date()
    private var checkPoint:Date = Date()
    init() {
        openGate()
    }
    init(pause:Int) {
        if pause < 0 || pause > 60 {return}
        self.pause = pause
        openGate()
    }
    func setPause(pause:Int) {
        if pause < 0 || pause > 60 {return}
        self.pause = pause
    }
    func openGate() {
        // the gate will stay open for pause minutes
        openDate.addTimeInterval(TimeInterval(pause * 60))
    }
    func openGateforNSeconds(_ n:Int) {
        // the gate will stay open for n seconds
        openDate.addTimeInterval(TimeInterval(n))
    }
    func isOpen() -> Bool {
        return Date() < openDate
    }
    func isClosed() -> Bool {
        return !isOpen()
    }
    func closeGate(){
        // force closes the gate
        openDate = Date()
    }
    func resetCheckPoint() {
        checkPoint = Date()
    }
    func timeFromCheckPoint() -> DateComponents{
        // get the time between reset check point and now
        let diffComponents:DateComponents = Calendar.current.dateComponents([.minute, .second], from: checkPoint, to: Date())
//        let minutes = diffComponents.minute ?? 0
//        let seconds = diffComponents.second ?? 0
        return diffComponents
    }
}
 

fukurou

the supreme coder
ADMIN
v2 time gate
Swift:
class TimeGate {
    private var pause: Int
    private var openedGate: Date
    private var checkPoint: Date

    init(_ minutes: Int) {
        self.pause = max(1, minutes)
        let now = Date()
        self.openedGate = now
        self.checkPoint = now
        Thread.sleep(forTimeInterval: 0.1)
    }

    func isClosed() -> Bool {
        return openedGate < Date()
    }

    func isOpen() -> Bool {
        return !isClosed()
    }

    func open(_ minutes: Int) {
        openedGate = Date().addingTimeInterval(Double(minutes * 60))
    }

    func open_for_n_seconds(_ seconds: Int) {
        openedGate = Date().addingTimeInterval(Double(seconds))
    }

    func openForPauseMinutes() {
        openedGate = Date().addingTimeInterval(Double(pause * 60))
    }

    func setPause(_ newPause: Int) {
        if 0 < newPause && newPause < 60 {
            pause = newPause
        }
    }

    func resetCheckPoint() {
        checkPoint = Date()
    }

    func getRunTimeTimeDifInSeconds() -> Int {
        let diff = checkPoint.timeIntervalSinceNow
        return Int(diff)
    }

    func close() {
        openedGate = Date()
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class LGFIFO: CustomStringConvertible {
    internal var queue: [String] = []

    var description: String {
        return queue.joined(separator: " ")
    }

    func isEmpty() -> Bool {
        return queue.isEmpty
    }

    func peak() -> String? {
        return isEmpty() ? nil : queue.first
    }

    func insert(_ data: String) {
        queue.append(data)
    }

    func poll() -> String {
        guard !queue.isEmpty else { return "" }
        return queue.removeFirst()
    }

    func size() -> Int {
        return queue.count
    }

    func clear() {
        queue.removeAll()
    }

    func removeItem(_ item: String) {
        if let index = queue.firstIndex(of: item) {
            queue.remove(at: index)
        }
    }

    func getRNDElement() -> String {
        return queue.randomElement() ?? ""
    }

    func contains(_ item: String) -> Bool {
        return queue.contains(item)
    }
}
 
Last edited:

fukurou

the supreme coder
ADMIN
Swift:
class UniqueItemsPriorityQue: LGFIFO {
    override func insert(_ data: String) {
        if !queue.contains(data) {
            queue.append(data)
        }
    }

    override func peak() -> String {
        return super.peak() ?? ""
    }

    func strContainsResponse(_ item: String) -> Bool {
        for response in queue {
            if response.isEmpty { continue }
            if item.contains(response) {
                return true
            }
        }
        return false
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class UniqueItemSizeLimitedPriorityQueue: UniqueItemsPriorityQue {
    private var _limit: Int

    init(_ limit: Int) {
        self._limit = limit
        super.init()
    }

    func getLimit() -> Int {
        return _limit
    }

    func setLimit(_ limit: Int) {
        self._limit = limit
    }

    override func insert(_ data: String) {
        if size() == _limit {
            _ = poll()
        }
        super.insert(data)
    }

    override func poll() -> String {
        return super.poll()
    }

    override func getRNDElement() -> String {
        return super.getRNDElement()
    }

    func getAsList() -> [String] {
        return queue
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class RefreshQ: UniqueItemSizeLimitedPriorityQueue {
    override init(_ limit: Int) {
        super.init(limit)
    }

    func removeItem(_ item: String) {
        if let index = queue.firstIndex(of: item) {
            queue.remove(at: index)
        }
    }

    override func insert(_ data: String) {
        if contains(data) {
            removeItem(data)
        }
        super.insert(data)
    }

    func stuff(_ data: String) {
        if size() == getLimit() {
            _ = poll()
        }
        queue.append(data)
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class AnnoyedQ {
    private var _q1: RefreshQ
    private var _q2: RefreshQ
    private var _stuffedQue: RefreshQ

    init(_ queLim: Int) {
        self._q1 = RefreshQ(queLim)
        self._q2 = RefreshQ(queLim)
        self._stuffedQue = RefreshQ(queLim)
    }

    func learn(_ ear: String) {
        if _q1.contains(ear) {
            _q2.insert(ear)
            _stuffedQue.stuff(ear)
            return
        }
        _q1.insert(ear)
    }

    func isAnnoyed(_ ear: String) -> Bool {
        return _q2.strContainsResponse(ear)
    }

    func reset() {
        for i in 0..<_q1.getLimit() {
            learn("throwaway_string_\(i)")
        }
    }

    func annoyedLevel(_ ear: String, _ level: Int) -> Bool {
        return _stuffedQue.getAsList().filter { $0 == ear }.count > level
    }
}
 
Top