
extension Array where Element: Equatable {

    @discardableResult
    mutating func remove(_ element: Element) -> Bool {
        guard let index = firstIndex(of: element) else {
            return false
        }
        remove(at: index)
        return true
    }
}
