Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bunny's Bags Coding UNSOLVED Problem Statement Your task is to help your dearest friend, Bunny. Initially, he had two gifts with their respective strings written

Bunny's Bags
Coding
UNSOLVED
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 writte 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 som 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 gift 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.
You are given String B in the second line, denoting the string written on one of the two gifts he had Initially.
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

Students also viewed these Databases questions

Question

9. Understand the phenomenon of code switching and interlanguage.

Answered: 1 week ago