Question #232868

Write an algorithm for the network
administrator to help him find the number
of data characters that do not change
position even after the data stream is
reversed.

Expert's answer

#The algorithm for network adminstrator
myString = 'ebebbe' #Using this set of characters as an example
data = list(myString) #Putting the characters in a list
string_reversed = list(reversed(myString)) #Reversing the list and storing it in a variables
st = "" #A string to store the characters that do not change the position
for row in string_reversed: #Iterating over the original characters
    for i in data: #Iterating over the characters after reversal
    #Checking if the position of character has not changed
        if string_reversed.index(row) == data.index(row): 
            st += i 
          
printf(set(list(st))) #Printing the final list of characters that do not change the position   

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS