This task involves image analysis and good knowledge of logarithmic equations. Though you can use any method to provide your solution.
Problem statement:- Assume there is a rectangular image. Each pixel in the image represents a point. A group of pixels forms a tile. The whole image is divided into a series of tiles. Now we wish to overlay a polygonal line on the rectangle.
You must identify all the points where the polygonal line touches the rectangle.
Input 1. A rectangle of length l and breadth b.
Input 2. An array of co-ordinates for the polygonal line.
Input 3. Size of the Squared tile. It can be of size PxP where P is the number of pixels.
Output:- Find out all the tiles from which the lines pass through.
Code challenges start on 09-Sep-2020 and end on 23-Sep-2020.
Rick Brownall
16 Jun 2021This is a good little coding challenge, perhaps something like this should be included on our coding tests for interviews platform!