+ 1
Triplets b/w L to R with minimal time complexity i.e, o () < o (n^3)
I need to find the triplets b/w L to R (eg. L=1, R = 2 then triplets will be (1,1,1),(1,1,2),(1,2,1),(2,1,1),(2,1,2).. and so on. I can do this by 3 nested loop but i want to do it optimally
1 Resposta
+ 2
Hello
How about this solution? I think it satisfies your time complexity requirement.
It can be simplified further but I kept the binary list for demonstration purpose.
https://code.sololearn.com/cnemSZrpb4q5/?ref=app