[称号] 原文: 1.8 Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, s1 and s2, write code to check if s2 is a rotation of s1 using only one call to isSubstring ( i.e., "waterbottle" is a rotat…
[链表] Q:Write code to remove duplicates from an unsorted linked list FOLLOW UP How would you solve this problem if a temporary buffer is not allowed? 题目:编码实现从无序链表中移除重复项. 如果不能使用临时缓存,你怎么编码实现? 解答: 方法一:不使用额外的存储空间,直接在原始链表上进行操作.首先用一个指针指向链…