LeetCode 1787. Make the XOR of All Segments Equal to Zero

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

8:24, I think the brute force approach should be O(1024^2000) instead of O(2000^1024) since we have 2000 places and each place can have 1024 options. (1024 * 1024 * 1024 * 2000 times) .

AbhishekKumar-yvih
Автор

The time complexity for the solution is probably O(k*1024*(n/k)) == O(1024nk), since Big O notation represents the worst case time complexity it takes to finish the program. Anyway, it improves a lot from the brute force solution which takes Θ(1024^2000) running time.

mingweihe
Автор

Insane Problem! Thanks for the explanation!

usmanusmonov