Amazon Interview Question

Asked to rearrange an array such that no 2 adjacent elements are same.