Answer to Question #232868 in C for Chandana

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.
1
Expert's answer
2021-09-03T15:08:26-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS