Given a string S, return the "reversed" string where all characters that are not a letter stay in the same place, and all letters reverse their positions. Example 1: Input: "ab-cd" Output: "dc-ba" Example 2: Input: "a-bC…
反转一个单链表. Reverse a singly linked list. 示例: 输入: 1->2->3->4->5->NULL 输出: 5->4->3->2->1->NULL 进阶: 你可以迭代或递归地反转链表.你能否用两种方法解决这道题? Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both?…
Given a string S, return the "reversed" string where all characters that are not a letter stay in the same place, and all letters reverse their positions. Example 1: Input: "ab-cd" Output: "dc-ba" Example 2: Input: "a-bC…
Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we could create. Examples: Input: S = "a1b2" Output: ["a1b2", "a1B2",…