9
wolfram
5y

Your code will always be O(1) when you are hardcoding everything.

Comments
  • 2
    ...and flattening out loops?
  • 3
    Tsm in O(1)? Np, hardcode it.
  • 1
    That's the advice I always considered 😀
  • 4
    You should be specific. Only time complexity will be O(1)
    Space complexity will be O(n), where n represents the set of all possible inputs that needs to be hardcoded and stored.
Add Comment