Spaceship Landing Strip

Spaceship Landing Strip

Simple
English RU

"Wow! That was a terrible landing!" Stephen was the first one to break the silence after the ship descended.

"Who set up the landing vector?" asked Sofia as she emerged from a heap of cables and shook ashes off herself. "Who borks it that badly? I bet that was the Ship's last landing ever!"

"I’m doing a systems check right now." said Nikola, brushing off Sofias comment. At the computer, typing away furiously, Nikola had this infamous do not disturb me look on his face. It seemed as though there were no computational errors.

“Well we’ve got loads of opportunity for adventure here!” Sofia said, making the best of a bad situation.

"Sofia, I beg you... don’t tell me what a great opportunity this is. The trip has already gotten off to the WORST possible start." Stephen responded tersely.

"Fine..."

"Geez, now I understand why expeditions to these lands happen so rarely…"

"It won't take off." Nikola announced, banging the console with his fist.

"What? The ship is fine! We can just fix the damage and continue on our journey," Sofia started hopefully.

"It’s not going to work. The engine is pretty well toasted and we don’t have the necessary parts to fix it."

"Awesome...” Stephen said, his voice dripping with sarcasm. “So now we're stuck here for the rest of eternity until we all bluescreen in the cold."

"Stephen, calm down," interrupted Sofia. "Is everything fine with the communications array? Can we call for help?"

"It’s only working one way... we can only send data," Nikola started saying slowly as he tested something on the computer. "We can't receive any data, so the receiver must be broken. I'll set the transmitter to continuously send out a mayday signal."

"Okay, let’s do that. Now, in order to be saved from this frozen... place, we’ll need to carve up a landing site. We can't have our potential resucuers crash and burn too."

"I'm already scanning the area and making a map to calculate the best place for them to land," Nikola said agreeing to Sofia’s proposition.

"Great! And I get to clear out the landing area, right?" said Stephen then paused. "Just in advance, I want to say that even though I am a handyman, I cannot move mountains or change the flow of rivers."

"I suppose we should take that into consideration... Now let's write a calculation module."

"Yeah, good idea. For now we can settle into this Rossum forsaken place."

The Robots have discovered a new island and accidentally crashed on it. Tо survive, they need to create the largest rectangular field possible to make a landing strip. While surveying the land, they encountered a number of obstacles which they marked on their map. Each square of the map is marked according to whether it contains grass (G), rock (R), water (W), shrubs (S), or trees (T). While the grass can be mowed and the shrubs can be dug from the ground, the water, rocks, and trees cannot be removed with the tools at their disposal. Given these obstacles, they need your help to determine the area of the largest possible rectangular field.

The island map is represented as a list of strings. Each string contains letter characters which indicate the conditions for each square of land (G, R, W, S, or T). The map is rectangular.

strip

strip

Input: An island map as a list of strings.

Output: The maximum area of the largest possible rectangle that can be cleared as an integer.

Example:

checkio(['G']) == 1
checkio(['GS', 'GS']) == 4
checkio(['GT', 'GG']) == 2
checkio(['GGTGG',
 'TGGGG',
 'GSSGT',
 'GGGGT',
 'GWGGG',
 'RGTRT',
 'RTGWT',
 'WTWGR']) == 9
checkio(['GSWGG', 'SGRST', 'WGSRS', 'RSSST']) == 4

How it is used: This concept touches on image and pattern recognition. If you solve the challenge with a Histogram search, you can use it for statistical analysis.

Precondition:
0 < len(landing_map) < 10
all(0 < len(row) < 10 for row in landing_map)

6
Settings
Code:
Other:
Invalid hot key. Each hot key should be unique and valid
Hot keys:
CheckiO Extensions

CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.

In order to install CheckiO client you'll need installed Python (version at least 3.8)

Install CheckiO Client first:

pip3 install checkio_client

Configure your tool

checkio --domain=py config --key=

Sync solutions into your local folder

checkio sync

(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)

checkio serv -d

Alternatevly, you can install Chrome extension or FF addon

checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium

Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.

Pair Programming (Beta-version)

Welcome to Pair Programming! Engage in real-time collaboration on coding projects by starting a session and sharing the provided unique URL with friends or colleagues. This feature is perfect for joint project development, debugging, or learning new skills together. Simply click 'Start Session' to begin your collaborative coding journey!

Waiting for Pair Programming to start...

You are trying to join a pair programming session that has not started yet.

Please wait for the session creator to join.

Waiting for Pair Programming to reconnect...

It looks like the creator of the pair programming session closed the editor window.

It might happen accidentally, so that you can wait for reconnection.

×
 
 
<< <
> >>
exec show

Whats Next?

Free accounts will see Best CheckiO solutions with some delay.
Best Solutions will be opened in a moment
Become Awesome and Don't wait
The next stage is ""
Will be activated in
View More Solutions Random Review Solutions Go to the next mission