mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-26 12:46:31 +08:00
21 lines
400 B
Swift
21 lines
400 B
Swift
|
/**
|
||
|
* File: Pair.swift
|
||
|
* Created Time: 2023-06-28
|
||
|
* Author: nuomi1 (nuomi1@qq.com)
|
||
|
*/
|
||
|
|
||
|
/* 鍵值對 */
|
||
|
public class Pair: Equatable {
|
||
|
public var key: Int
|
||
|
public var val: String
|
||
|
|
||
|
public init(key: Int, val: String) {
|
||
|
self.key = key
|
||
|
self.val = val
|
||
|
}
|
||
|
|
||
|
public static func == (lhs: Pair, rhs: Pair) -> Bool {
|
||
|
lhs.key == rhs.key && lhs.val == rhs.val
|
||
|
}
|
||
|
}
|