Your question is Power Under a Maximum. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
A Veeam Backup & Replication policy may need to determine the largest growth exponent that keeps a calculated value within a configured limit. Given positive integers maxVal and a, return the largest non-negative integer b such that a^b <= maxVal.
Use integer arithmetic only. Do not rely on floating-point logarithms, because rounding can produce an incorrect exponent near an exact power.
Implement biggest_power_exponent(maxVal, a):
maxVal and ab >= 0 satisfying a^b <= maxVala >= 2 and maxVal >= 1You should avoid computing unnecessarily large powers. A suitable solution first finds an upper bound for b, then uses binary search with overflow-safe, capped exponentiation.
def biggest_power_exponent(maxVal, a):