Codeforces - Spotlights -Logic To Find Good Spotlight Positions In 2 D Grid Explained With Java Code

Publié le: 18 novembre 2021
sur la chaîne: AlgorithmicIQ
156
3

Codeforces Spotlights Logic To Find Good Spotlight Positions In 2 D Grid Explained With Java Code & Examples.

If you find this video helpful, please 'Like' & 'Subscribe'.
This is really helpful for the channel and also motivates me to do more of such good videos.

Link To The Problem:
https://codeforces.com/problemset/pro...

Problem Description:
Theater stage is a rectangular field of size n × m. The director gave you the stage's plan which actors will follow. For each cell it is stated in the plan if there would be an actor in this cell or not.

You are to place a spotlight on the stage in some good position. The spotlight will project light in one of the four directions (if you look at the stage from above) — left, right, up or down. Thus, the spotlight's position is a cell it is placed to and a direction it shines.

A position is good if two conditions hold:

there is no actor in the cell the spotlight is placed to;
there is at least one actor in the direction the spotlight projects.
Count the number of good positions for placing the spotlight. Two positions of spotlight are considered to be different if the location cells or projection direction differ.

Youtube channel:    / @maksrane100  

https://github.com/maksrane100/codefo...
https://github.com/maksrane100/leetco...

#coding #softwareengineer #Leetcode #Algorithm #DataStructure #Java #programmer #tech #software #codinglife #Preparation
#interview #programminglife #programmingisfun #matrix


Sur cette page du site, vous pouvez voir la vidéo en ligne Codeforces - Spotlights -Logic To Find Good Spotlight Positions In 2 D Grid Explained With Java Code durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur AlgorithmicIQ 18 novembre 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 156 fois et il a aimé 3 téléspectateurs. Bon visionnage!