Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem Statement Your task is to help your dearest friend, Bunny. Initially, he had two gifts with their respective strings written on them. The strings
Problem Statement
Your task is to help your dearest friend, Bunny. Initially, he had two gifts with their respective strings written on them. The strings written on the gifts consisted of digits from to and it was ensured that the strings didn't start with zeroes. Bunny considers each written string as the weight of the gift on which it's written. Then, after some time, on the same day, he got a big basket assume you will find gifts of all weights here if needed filled with so many packed gifts inside it; each gift has a string written on it which does not contain any leading zeroes. Bunny is now allowed to take only one gift out of the gifts kept in the basket and gifts he had initially. He is allowed to do only one operation
in one move, he can take any gift out of the basket equal to the absolute difference between the two gifts he has outside the basket, but every time he does this, he will have to do an exchange, such that if he takes one gift out of the basket, he will have to keep one too in the basket.
He is lazy, so he wants you to tell him the minimum possible weight of the gift that he can pick so that he can take that to his home easily.
Input Format
You are given String in the first line, denoting the string written on one of the two gifts he had Initially.
Vou are given String B in the second line, denoting the string written on one of the two gifts he had Initially.
Constraints
size of string
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started