Answered step by step
Verified Expert Solution
Link Copied!

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 0 to 9, 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 >0 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 A 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
O size of string A,B=12
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions