adds solution for rotated array