InterviewDB Question

Winning Tiles: Determine the Victor in a Tile-Claiming Game

Question Details

Problem Two players take turns claiming tiles from a 1D array of integer-valued tiles. Each turn, the current player must take from either the left end or the right end. Both play optimally to maximize their own score. Return the score difference (player 1 score minus player 2 score) at the end of the game. Follow-ups Define the recurrence dp[i][j] = best score difference achievable by the current player on subarray [i..j]. What is the time and space complexity of the DP solution? If tiles can h…

Full Details

🔒

Unlock all Ziphq questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a reported interview question from a ziphq interview during the phone round.

It covers the following topics: Dynamic Programming, Phone, Coding, Arrays, Onsite .