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.
Candles Counting
Candles Counting
Sort by
recency
|
29 Discussions
|
Please Login in order to post a comment
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Candles Counting Problem Solution
Here is Candles Counting problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-candles-counting-problem-solution.html
Alice has 'a' candles. Each candle burns for one hour and then goes out. Alice, being a smart person, can make a new candle from 'b' went out candles. This new candle can be used like any other candle. Given 'a' and 'b', find the maximum number of hours Alice can light the candles. Assume that the value of ‘b’ is strictly greater than 1.
Have anyone been able to solve this in python ??
why is this solution giving TLE, even though its time complexity is O(2**K N log N) as given in the editorial.