aboutsummaryrefslogtreecommitdiff
path: root/underground_system.cpp
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-02-03 15:37:19 -0700
committerJack Sangdahl <[email protected]>2025-02-03 15:37:19 -0700
commit55a67f776dd9acd258cae16ffb636751666b0f40 (patch)
tree601539de43809b70ceb8228a12c35883fa300b03 /underground_system.cpp
parenta0030873dabb517594ae0394350d6715071f7fb8 (diff)
downloadleetcode-55a67f776dd9acd258cae16ffb636751666b0f40.tar.gz
leetcode-55a67f776dd9acd258cae16ffb636751666b0f40.zip
chore: Remove incomplete solutions
Diffstat (limited to 'underground_system.cpp')
-rw-r--r--underground_system.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/underground_system.cpp b/underground_system.cpp
deleted file mode 100644
index fd4fbbf..0000000
--- a/underground_system.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "leetcode.h"
-
-class UndergroundSystem {
-public:
- unordered_map<int, pair<string, int>> checkIns;
- unordered_map<string, pair<int, int>> routes;
- UndergroundSystem() {}
- void checkIn(int id, string stationName, int t) {
- checkIns[id] = {stationName, t};
- }
- void checkOut(int id, string stationName, int t) {
- auto [stn, start] = checkIns[id];
- checkIns.erase(id);
- string route = stn + "," + stationName;
- routes[route].first++;
- routes[route].second += t - start;
- }
- double getAverageTime(string startStation, string endStation) {
- auto &[count, sum] = routes[startStation + "," + endStation];
- return (double)sum / count;
- }
-};
-
-int main() {}