We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Basically, we're looking for the smallest area which intersects all the "rectangles" formed by the steps. That'll be the minimum x-length of any rectangle times the minimum y-length of any rectangle. The zip step converts the steps into a list of 2 lists, one with all x-lengths and one with all y-lengths.
Hope that helps!
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Rectangular Game
You are viewing a single comment's thread. Return to all comments →
Python 3 solution:
Basically, we're looking for the smallest area which intersects all the "rectangles" formed by the steps. That'll be the minimum x-length of any rectangle times the minimum y-length of any rectangle. The zip step converts the steps into a list of 2 lists, one with all x-lengths and one with all y-lengths.
Hope that helps!