kunal-kushwaha / DSA-Bootcamp-Java

This repository consists of the code samples, assignments, and notes for the Java data structures & algorithms + interview preparation bootcamp of WeMakeDevs.
https://www.youtube.com/playlist?list=PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ
16.07k stars 10.45k forks source link

CODE FOR PATTERN 31 #1248

Open aishwarypandey30 opened 6 months ago

aishwarypandey30 commented 6 months ago

https://github.com/kunal-kushwaha/DSA-Bootcamp-Java/blob/325361dd2e9ab2d50bc7d2eeefada97d3d9db0d0/lectures/13-patterns/code/src/com/kunal/Main.java#L8C22-L8C22

Hello, I am writing this to let u know that the code for pattern 31 is slightly wrong when you are taking n=2n; the loop is running more times than it should just change the code n=2(n-1) the code would be correct.

Please kindly see to it. And let me know If I am wrong.

Thank you