4 ms·
"Cool, so what do you think would be the time complexity of that? Do you think we can maybe do better than that?"
by oneepic 4y ago
"Cool, so what do you think would be the time complexity of that? Do you think we can maybe do better than that?"
- jameshart 4y agoActually it turns out it's O(n). Which goes to show that constant factors can be more important than you think when looking at raw time complexity big-O.
- nullc 4y agoEhhhh, it's O(n) when the string to be reversed is bounded under its input window. Because of self-attention it would grow quadratically for larger inputs, no?
- visarga 4y agoNot if you also want a short poem where each word starts with a letter from the original word, and then a short literary commentary on it.