My LeetCode grinding. Trying to do a problem a day.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

problem.txt 458B

123456789101112131415161718
  1. Write a function that reverses a string. The input string is given as an array of characters char[].
  2. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
  3. You may assume all the characters consist of printable ascii characters.
  4. Example 1:
  5. Input: ["h","e","l","l","o"]
  6. Output: ["o","l","l","e","h"]
  7. Example 2:
  8. Input: ["H","a","n","n","a","h"]
  9. Output: ["h","a","n","n","a","H"]