My issue
i dont know the hidden test case in this code
My code
def steps_to_divisible_by_3(x):
steps = 0
while x % 3 != 0:
x -= 1
steps += 1
return steps
# Input list
inputs = [4, 0, 100, 32, 18]
# Process each input and print the result one by one
for x in inputs:
print(steps_to_divisible_by_3(x))
Learning course: Design and Analysis of Algorithms
Problem Link: Problem(High Accuracy)- Solve the complete problem in Design and Analysis of Algorithms