Given integers A and B, transform A into B using the minimum number of operations. Allowed operations:
(
-
subtract 1 from the current value;
(
-
multiply the current value by 2. For each sample, determine the minimum number of operations and explain your approach and its time complexity: Sample 01: A = 1, B = 2; Sample 02: A = 9, B = 1; Sample 03: A = 2, B = 10; Sample 04: A = 100, B = 500.