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.
- Journey to the Moon
- Discussions
Journey to the Moon
Journey to the Moon
Sort by
recency
|
17 Discussions
|
Please Login in order to post a comment
JavaScript
Easy C++ Solution:
TypeScript (Using UnionFind)
Java8, int return fails at test case 11; changing to long fixes it
The C++ template is broken: it has the function journeyToMoon return an int, but the answer can be too large for int. To pass all test cases you need to a) change the return type, e.g. to long long b) look in main() to change variable
result
to a long long c) obviously make sure your actual solution avoids overflow error.