Computer Science, asked by DEEPAKABC, 8 months ago

A ceremony where a Bride chooses her Groom from an array of eligible bachelors is called Swayamvar. But this is a Swayamvar with difference. An array of Bride-to-be will choose from an array of Groom-to-be.

Answers

Answered by xSahiBx
0

Answer:

Brainly.in

What is your question?

xSahiBx

himabindhupolineni28

Yesterday

Computer Science

Secondary School

+5 pts

Answered

ceremony where a Bride chooses her Groom from an array of eligible bachelors is called Swayamvar. But this is a Swayamvar with difference. An array of Bride-to-be will choose from an array of Groom-to-be. The arrangement at this Swayamvar is as follows · Brides-to-be are organized such that the most eligible bachelorette will get first chance to choose her Groom. Only then, the next most eligible bachelorette will get a chance to choose her Groom · If the initial most eligible bachelorette does not get a Groom of her choice, none of the Brides-to-be have any chance at all to get married. So unless a senior bachelorette is out of the “queue”, the junior bachelorette does not get a chance to select her Groom-to-be · Inital state of Grooms-to-be is such that most eligible bachelor is at the head of the “queue”. The next most eligible bachelor is next in the queue. So on and so forth. · Now everything hinges on the choice of the bachelorette. The most eligible bachelorette will now meet the most eligible bachelor. · If bachelorette selects the bachelor, both, the bachelorette and the bachelor are now Bride and Groom respectively and will no longer be a part of the Swayamvar activity. Now, the next most eligible bachelorette will get a chance to choose her Groom. Her first option is the next most eligible bachelor (relative to initial state) · If the most eligible bachelorette passes the most eligible bachelor, the most eligible bachelor now moves to the end of the queue. The next most eligible bachelor is now considered by the most eligible bachelorette. Selection or Passing over will have the same consequences as explained earlier. · If most eligible bachelorette reaches the end of bachelor queue, then the Swayamvar is over. Nobody can get married. · Given a mix of Selection or Passing over, different pairs will get formed. The selection criteria is as follows 1. Each person either drinks rum or mojito. Bride will choose groom only if he drinks the same drink as her.

1

SEE ANSWER

ADD ANSWER

Ask himabindhupolineni28 about this question...

Answers

himabindhupolineni28 is waiting for your help.

Add your answer and earn points.

OjhapriyanshHelping Hand

Answer:

n = int(input())

b = input()

g = input()

c = 0

for i in b:

# print(b)

if i not in g:

break

for j in g:

# print(j)

#print(g)

if i == j:

a = b.find(f"{i}")

b = b[0 : a : ] + b[a + 1 : :]

a = g.find(f"{j}")

g = g[0 : a : ] + g[a + 1 : :]

c += 1

break

elif i != j:

a = g.find(f"{j}")

g = g[0 : a : ] + g[a + 1 : :]

#g = g.lstrip(f"{j}")

g = g + f"{j}"

print(n-c)

#print(c)

Answered by nidaeamann
0

Answer:

Explanation:

The statement given above can be programmed as below. The programming language used here is Python;

CODE;

n = int(input())

string1 = input()

string2 = input()

indicator = 0

for i in range(n):

  indicator = 0

  for j in range(n):

      if len(string2)!= 0:

          if string1[i] != string2[0]:

              string2 = string2[1::]+string2[:1:]

          else:

              string2 = string2[1::]

              indicator = 1

              break

      else:

          indicator = 1

          break

  if indicator == 0:

      break

if len(string2) == 0:

  print(0)

else:

  print(len(string2))

Similar questions