Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 008fa36

Browse files
344 Reverse String
1 parent 46c2395 commit 008fa36

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

‎string/main.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,45 @@
3131
# num2=num2/10
3232
# return str(num2)
3333

34+
################*******@Ziyodev*********######################
35+
36+
#------------------- 344. Reverse String -----------------#
37+
# start | 23:11
38+
# end | 23:44
39+
40+
# class Solution(object):
41+
# def reverseString(self, s):
42+
# """
43+
# :type s: List[str]
44+
# :rtype: None Do not return anything, modify s in-place instead.
45+
# """
46+
# sana = 0
47+
# list_len = (len(s) / 2)
48+
# if list_len %2 != 0:
49+
# list_len - 1
50+
# while sana < list_len:
51+
# head = s[sana]
52+
# s[sana] = s[-1-sana]
53+
# s[-1-sana] = head
54+
# sana += 1
55+
# return s
56+
57+
# s = ["s","a","l","o","m"]
58+
# test = Solution()
59+
# answer = test.reverseString(s)
60+
# print(answer)
61+
62+
######################### compact solution ##########################
63+
64+
# class Solution(object):
65+
# def reverseString(self, s):
66+
# """
67+
# :type s: List[str]
68+
# :rtype: None Do not return anything, modify s in-place instead.
69+
# """
70+
# l=[]
71+
# l.append(s.reverse())
72+
# return l
73+
74+
3475
################*******@Ziyodev*********######################

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /