Answer: Flipkart , Online Assessment Questions (17th August 2023 | SDE Intern) | Items S

Answer · Posted Aug 2023

  Q : Taxi Company - My Solution #include <bits/stdc++.h> using namespace std; #define pii pair<int, pair<int, int>> int main() { int n, m; cin >> n >> m; unordered_map<int, vector<pii>> mp(n + 1); // u -> { v, {state, national} } for (int i = 0; i < m; i++) { int u, v, state, national; cin >> u >> v >> state >> national; mp[u].push_back({v, {state, national}}); mp[v].push_back({u, {state, national}}); } int city1, city2; cin >> city1 >> ...

The full answer & interview discussion are available to premium members.

Log in Create a free account