My LeetCode grinding. Trying to do a problem a day.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

problem.txt 696B

123456789101112131415161718192021222324252627282930313233343536
  1. Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character.
  2. Example 1:
  3. Input: S = "ab#c", T = "ad#c"
  4. Output: true
  5. Explanation: Both S and T become "ac".
  6. Example 2:
  7. Input: S = "ab##", T = "c#d#"
  8. Output: true
  9. Explanation: Both S and T become "".
  10. Example 3:
  11. Input: S = "a##c", T = "#a#c"
  12. Output: true
  13. Explanation: Both S and T become "c".
  14. Example 4:
  15. Input: S = "a#c", T = "b"
  16. Output: false
  17. Explanation: S becomes "c" while T becomes "b".
  18. Note:
  19. 1 <= S.length <= 200
  20. 1 <= T.length <= 200
  21. S and T only contain lowercase letters and '#' characters.
  22. Follow up:
  23. Can you solve it in O(N) time and O(1) space?