Calculate The Time Complexity