Replace with pi problems

In this problems , we are iterating through each elements so the time comp 0(N) or also some extra space is there which is roughly equal to 0(N)?? is this the right analysis??

hello @Vikaspal
yeah time complexity will -> O(n)

space complexity -> O(n) //n calls cause n function on system stack

@aman212yadav okay the usually no of stack defined how many calls are made and then accordingly we can derive the space complexity right…

yeah. … … … … … . …

@aman212yadav one more guidlance/advice from ur end bro. konse topic cover kargu for aptitute and logical reasoning because sometimes there are huge mcq question are asked. I am not confident about aptitude question…?? Tips and tricks…??

u can practice questions on india bix.
btw weightage of coding questions r always higher as compared to aptitude. so if u r able to solve coding questions then u need not to worry about it .

also aptitude is not tough. u just need speed.
and to gain speed u need to practice

@aman212yadav got it bro… and most of the questions in mcq is variation of time complexity means we need to compute the time and space how much the algo is going to taking… so what the best to practice this… GFG has limited quesiton i think…

i havent practice it much.
i have watched abdul bari playlist to clear my concepts.
u can refer them he has covered almost all techniques.
that is more than sufficient in my opininon

@aman212yadav okay i checkout it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.