Passed Java Solution & Missing Test Case

  • 0

    Here is my passed solution. However, if you tried (1000,15,14), the website output null while my program out put "2147483647". It is better to add some description like test_time > time_to_die.

    public static Integer longestPalindrome(int buckets, int minutesToDie, int minutesToTest) {
            int base = minutesToTest/minutesToDie + 1;
            double ans = Math.log(buckets)/Math.log(base);
            return (int)Math.ceil(ans);

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.