the code has two independent loops inside the pat() function, each of which runs for logn time. So time complexity should be O(logn + logn) => O(logn). Am I correct?
the code has two independent loops inside the pat() function, each of which runs for logn time. So time complexity should be O(logn + logn) => O(logn). Am I correct?