Sly32

Рейтинг
391
Регистрация
29.03.2012
Должность
Software engineer

I made their algorithm to pass tests, but still woefully bad. But this is still too much, though, and on heshtab, While I can not be cut in the algorithm (


Runtime: 5964 ms, faster than 8.52% of Python3 online submissions for Two Sum.
Memory Usage: 16 MB, less than 5.77% of Python3 online submissions for Two Sum.


---------- Posted 18.06.2020 at 17:47 ----------

Danforth:
http://imgur.com/28teQGyl.png

It's like this for 0 seconds? 🤪

danforth, я неправильно флаг поставил и в итоге был вообще нерабочий код который только 1 раз выполнялся)

Поправил, но теперь тест не проходит Output Limit Exceeded

Danforth, I put the wrong flag and eventually was generally non-working code that is executed only one time)

I corrected, but now the test fails Output Limit Exceeded

danforth:
В твоей функции нет аргументов, она их берет из объекта. Вот тот код что я скинул для питона, тебе нужно внутри функции написать код, без селфов

🍾 Ну ок, поменял

https://pastebin.com/3zZ45mts

Danforth:
In your function has no arguments, it takes them out of the object. Here's the code that I threw for python, you need to write code in a function, without self

🍾 Well ok, changed

https://pastebin.com/3zZ45mts

danforth, Так правильно?

https://pastebin.com/3zZ45mts

Навалилось работы счас, поэтому это первое решение что пришло в голову и оно далековато от оптимального, понимаю, причем если искать все индексы для числа - попадут дубли - отсюда видно что неоптимал, может позже поиграюсь еще

Danforth, so right?

https://pastebin.com/3zZ45mts

Nawal work Wait, so this is the first solution that came to mind, and it is far from optimal, understand, and if you look for all the indices for the number - get doubles - This shows that neoptimal can play more later

Для поиска первой пары индексов:

https://pastebin.com/3zZ45mts

Return я немного изменил, соответственно тайпхинты в условии тоже подкорректировал, думаю это несущественно, но нагляднее

To find the first pair of indices:

https://pastebin.com/3zZ45mts

Return I was little changed accordingly tayphinty in the condition corrected, too, think this is not essential, but clearer

LazyBadger:
noname "вебстроитель" без собственного достойного сайта - это не сапожник без сапог, это школотрон на улице

Да, но приведи пример серьезного сайта у небольшой студии? Обычно у студий с составом до 15-20 чел такое г висит, что кажется- лучше бы уж вообще не было. Сначала делают лэндинг, потом забивают на него в итоге висит мертвым грузом

Всего: 8320