-
Notifications
You must be signed in to change notification settings - Fork 262
Reverse String
Andrew Burke edited this page Apr 10, 2024
·
3 revisions
Unit 3 Session X (Click for link to problem statements)
Understand what the interviewer is asking for by using test cases and questions about the problem.
- Q
- A
Plan the solution with appropriate visualizations and pseudocode.
General Idea: TODO
1) TODO
def reverse_string(s):
return s[::-1]
# OR
def reverse_string(s):
reversed_s = ''
for char in s:
reversed_s = char + reversed_s
return reversed_s