脸熟实习

总共 45 分钟 2 题

第一题
Caesar Cipher Encrpytion
You are given a list of string, group them if they are same after using Ceaser Cipher Encrpytion.
Definition of “same”, “abc” can right shift 1, get “bcd”, here you can shift as many time as you want, the string will be considered as same.

Example:

Input: [“abc”, “bcd”, “acd”, “dfg”]
Output: [[“abc”, “bcd”], [“acd”, “dfg”]]

第二题
Implement OrderedSet
.add(num)
.remove(num)
.toArray()
.contain(num)