A higher resolution is required to access the IDE
- 30
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Goal
These fractals are more similar to those of Bill Williams, which are used in price chart analysis, rather than fractals of Benoit Mandelbrot.Place fractals around extremums of the image.
An extremum is a pixel P that is filled (
East fractal is represented by
North =
North-east =
North-west =
South =
South-east =
South-west =
West =
To place a fractal to the north ("3") of pixel P, pixels "9", "5", "3", "4", "2" around pixel P must be empty.
To place a fractal to the northeast ("4") of pixel P, pixels "5", "3", "4", "2", "7" around pixel P must be empty.
Input
An integer imageSize for the width and height of the square image.
Next imageSize lines: strings of1 and 0 pixels, space separated.
Next imageSize lines: strings of
Output
imageSize lines: strings containing pixels and fractals, space separated.
Constraints
imageSize = 10
Each pixel color is "0" or "1"
Each pixel color is "0" or "1"
Example
Input
10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
Output
0 0 0 0 0 0 3 4 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 9 1 0 0 1 0 0 0 0 0 8 6 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 8 6 7 0 0
A higher resolution is required to access the IDE