We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Search
- Gridland Metro
- Discussions
Gridland Metro
Gridland Metro
Sort by
recency
|
425 Discussions
|
Please Login in order to post a comment
Here is solution in python, java, c++ and c programming - https://programmingoneonone.com/hackerrank-gridland-metro-problem-solution.html
In C++11, the output type needs to be updated from int to long long. Ensure this change is also applied within the main function.
C++ solution with long long instead of int
There's a mistake in the stub code given for C++14 - the function we need to write should return 'long long' type, not 'int'. Otherwise the results gets truncaded for the large input.
import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Scanner;
public class Solution {
}