Akamai coding test question...
program to manipulate the string such that a sub-string given from a string should be replace by another given string. for ex:
sunday su mo => monday
ghosthouse house tree => ghosttree
code in python..
num = int(raw_input())
for i in range(num):
s = raw_input().split(' ')
print s[0].replace(s[1],s[2])
program to manipulate the string such that a sub-string given from a string should be replace by another given string. for ex:
sunday su mo => monday
ghosthouse house tree => ghosttree
code in python..
num = int(raw_input())
for i in range(num):
s = raw_input().split(' ')
print s[0].replace(s[1],s[2])
No comments:
Post a Comment