Time complexity
CodeChefOpen on judge ↗
For the following program, find the time complexity. Then, based on the input N, print the value For example if the time complexity is O(n^2), and N=4, Output would be 4^2 = 16 C++: int func(int n)\ { if (n <= 1) return n; return func(n - 1) + func(n - 2); } Python: def func(n): if n <= 1: return n; return func(n-1) + func(n-2); Java: static int func(int n)
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start