Company: Microsoft intern
Difficulty: medium
Square Tile Arrangement Create a 4×4 square by arranging four 1×1 tiles into a 2×2 square, and surrounding it by 2×2 tiles. Example Cases: Given M = 0 and N = 18, your function should return 8. You need to use sixteen 2×2 tiles to create the square. Note that not all tiles are used. Given M = 13 and N = 3, your function should return 5. One of the possible arrangements is shown in the following image: Constraints: M and N are integers within the range [0..1,000,000,000] Task: Write an efficient algorithm for the given assumptions. Copyright 2009-2024 by Codility Limited. All Rights Reserved. Unauthorized copying, publication or disclosure prohibited.