3 ms·
Should also add that an inefficient solution for a mostly fixed input size is still going to be efficient. If you have to write a double for loop but the outer
by volkk 6y ago
Should also add that an inefficient solution for a mostly fixed input size is still going to be efficient. If you have to write a double for loop but the outer loop is iterating on a 1000 element array and the inner one is operating on a 26 element array (e.g alphabet), it's still a fast and probably good enough solution.
- gvx 6y agoOperating on a fixed size datatype is trivially O(1), too (because O(c) = O(1) when c is a constant).