Given a string s and an integer array shift, apply the indicated positional shifts to the string and return the resulting string. A positive shift moves the string to the right, while a negative shift moves it to the left. Optimize the implementation.
s = "abc", shift = [1, -1, 3]
"cab"
Input:
abc
1 -1 3
Output: