-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblem1.py
More file actions
40 lines (33 loc) · 745 Bytes
/
Copy pathproblem1.py
File metadata and controls
40 lines (33 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(S):
"""
:param S:
:return:
"""
# get the length of the string
l =len(S)
# instantiating the Answer
ans =""
for n in range(l):
print n
# iterate over the string
if S[n]> S[n+1]:
for m in range(l):
if (n!=m):
ans +=S[m]
print ans
return ans
# else:
# now leave the last charact
ans=S[0:l-1]
print ans
return ans
# write your code in Python 3.6
# b=list(S)
# print(b)
# b.sort()
# print(b)
# pass
if __name__ == '__main__':
solution("codility")