알고리즘
[Leetcode/Python] Reverse String
Top Interview Questions 의 Easy Collection에 있는 문제입니다. 문제는 여기서 볼 수 있습니다. 1. s를 뒤집어라. 2. s가 아닌 다른 변수를 만들어서 문제를 풀지 말고, s 자체를 바꾸어라.(in-place) 3. 메모리는 추가적으로 O(1)만 사용할 수 있다. Example 1: Input: s = ["h","e","l","l","o"] Output: ["o","l","l","e","h"] Example 2: Input: s = ["H","a","n","n","a","h"] Output: ["h","a","n","n","a","H"] Constraints: 1
2022. 8. 21. 00:13