Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- bool graph(int N, vector<vector<int>> adj) {
- for (int i = 0; i < N; i++) {
- for (int j = 0; j < N; j++) {
- for (int k = 0; k < N; k++) {
- if (adj[i][j] > adj[i][k] + adj[k][j]) {
- return false;
- }
- }
- }
- }
- return true;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement