Pinterest will cut hundreds of jobs and reduce office space in order to prioritize spending on AI-related efforts.