I am a bit confused here what's the difference? given--> (1 ≤ n ≤ 10^18)
Approach — 1 long min = n/6+(n % 6 > 0 ? 1 : 0);
Approach — 2 long min = (long)Math.ceil((n * 1.0)/6);
Approach — 1 passed all the test cases
Approach — 2 failed on large values of n








try
The result should be 1e18 — 2 but instead it will print 1e18
The issue is that there are some approximation errors in doubles/floats, they are not 100% accurate an infamous example is comparing 0.1 + 0.2 to 0.3
Approach 1 doesn't use floating points, that's why it works
oh!! got it Thanks