Check Divisibility by Digit Sum and Product

Solution Code

Time Complexity

O(log n)

Space Complexity

O(1)