Skip to content

Commit 373a7fb

Browse files
committed
updated mutation problem solution as it is updated in Hackerrank
1 parent fabf789 commit 373a7fb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Strings/Mutations.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
Domain : Python
55
Author : Ahmedur Rahman Shovon
66
Created : 15 July 2016
7+
Updated : 25 October 2019
78
Problem : https://www.hackerrank.com/challenges/python-mutations/problem
89
'''
9-
# Enter your code here. Read input from STDIN. Print output to STDOUT
10-
s=raw_input()
11-
in_str_ar=raw_input().strip().split()
12-
pos=int(in_str_ar[0])
13-
c=in_str_ar[1]
14-
final_str=s[:pos]+c+s[pos+1:]
15-
print final_str
10+
def mutate_string(string, position, character):
11+
return string[:position]+character+string[position+1:]
12+

0 commit comments

Comments
 (0)