Write the numbers 1 to 4, indicating the heights of skyscrapers, and the letter K, indicating a cookie, into the grid such that in every row and column every symbol appears exactly once. Numbers at the edge of the grid determine how many skyscrapers are visible in this direction. Higher skyscrapers hide lower skyscrapers. Cookies do not hide any skyscrapers. Place one cookie monster on a skyscraper of height 3. The monster looks in straight lines in horizontal, vertical and diagonal direction. Lower skyscrapers of heights 1 and 2 do not block its view. The cookie monster does not see any cookies.
Solution code: Rows 2 and 4 from left to right