Modify matrix boundary and interior elements
Filed under Thoughtworks
The question
Given an n x m matrix of integers, double the values of all elements lying along the edges (boundaries) and halve the values of all interior elements.
No write-up yet. Related questions below have one.
Related Thoughtworks questions
Collected from public candidate posts and coding forums. Updated Nov 2026.