Тёмный

165 - Gridland Metro | Search | Hackerrank Solution | Python 

Hackers Realm
Подписаться 25 тыс.
Просмотров 1,8 тыс.
50% 1

Опубликовано:

 

27 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 12   
@minhle9868
@minhle9868 5 дней назад
The non-overlapping-same-row calculation is only correct if you have track 1 and track 2 non-overlapping but not for multiple tracks on the same row. Imagine you have n = 1, m = 7, k = 3 (all on row 1): track 1 at [1,3], track 2 at [5,6] and track 3 at [6,7] then we incorrectly calculate the result = 0 lamps. We should be able to place a lamp at pos 4. Somehow HackerRank only has test case with maximum 2 tracks on the same row or 3 tracks but they are completely non-overlapping. I love the thought process and the use of dictionary anw, thanks for this!
@swetalj7265
@swetalj7265 4 месяца назад
i did not get no overlap and overlap conditions ,why they are written for?
@amvibo
@amvibo 3 года назад
Thank you for the video series ! quite helpful :)
@HackersRealm
@HackersRealm 3 года назад
Happy to help!!!
@michaelchandriotis7225
@michaelchandriotis7225 День назад
the solution does not account for when an overlap can occur where c1 is smaller than the current c1 stored in d it also does not account if there is no overlap but there is a train track that is before the one in the same row if that was already calculated You are lucky hackerank has bad test cases!
@md.masiud3495
@md.masiud3495 3 года назад
cant we do it directly like frist calculate the difference add 1 and then subtracring it from total
@HackersRealm
@HackersRealm 3 года назад
if we do that, we can't get correct result for the overlapped ones
@md.masiud3495
@md.masiud3495 3 года назад
@@HackersRealm can u please guide me like i think of approcahes but when i implement it it throws errors so how should i think like how to develop approaches
@HackersRealm
@HackersRealm 3 года назад
@@md.masiud3495 It will take time to get some new approaches, try to see job interview prep playlist for some tips!!
@tysontakayushi8394
@tysontakayushi8394 11 месяцев назад
This solution can't be correct.
@HackersRealm
@HackersRealm 11 месяцев назад
Could you please explain why do you think that?
@thanginh78
@thanginh78 Год назад
Wrong answer with a test case: 1 10 3 1 1 5 1 7 8 1 8 8
Далее
skibidi toilet 77 (part 4)
05:20
Просмотров 13 млн
10 Important Python Concepts In 20 Minutes
18:49
Просмотров 232 тыс.
Fastest way to learn Data Structures and Algorithms
8:42
Coding a Web Server in 25 Lines - Computerphile
17:49
Просмотров 341 тыс.
Diagonal Difference - HackerRank Solution (Java)
14:45
What does '__init__.py' do in Python?
6:50
Просмотров 60 тыс.
HackerRank  -  Gridland Metro (Java)
13:36
Просмотров 425
Non-Divisible Subset | Hackerrank | Medium
13:11
Просмотров 13 тыс.