Pagini recente » Diferente pentru blog/meet-in-the-middle intre reviziile 59 si 60 | Diferente pentru concurs-mihai-patrascu-2013 intre reviziile 13 si 14 | Istoria paginii planificare/sedinta-20071218 | Diferente pentru warm-up-2019/solutii/shoturi intre reviziile 68 si 69 | Diferente pentru blog/meet-in-the-middle intre reviziile 65 si 66
Nu exista diferente intre titluri.
Diferente intre continut:
h2. 4sum
bq. Given A, an array of integers, find out if there are any four numbers such that their sum equals zero. For example given A = [2, 3, 1, 0, -4, -1] a solution is 3 + 1 + 0 - 4 = 0 or 0 + 0 + 0 + 0 = 0 (you can use the same number more than once).
bq. Given A, an array of integers, find out if there are any four numbers such that their sum equals zero (you can use the same number more than once). For example given A = [2, 3, 1, 0, -4, -1] a solution is 3 + 1 + 0 - 4 = 0 or 0 + 0 + 0 + 0 = 0.
The naive algorithm tries all the possible combinations of four numbers. This solution takes $O(N^4^)$ time.
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.