Check whether a number can be written as a^b + b^a (Leyland number)
Company: Toyota
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Other
Overview: Decide whether a positive integer up to 10^18 is a Leyland number, meaning it can be written as a^b + b^a with a and b both greater than 1. It tests bounding a brute-force search by exponential growth and computing large powers without overflow or floating-point error.