How can I make my code less complex? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can I make my code less complex?

I know how to solve problems, but the solutions i propose are of high complexity(especially time complexity) . Can anyone suggest me, how do I code / write less complexity codes.

7th Sep 2020, 3:49 PM
Pratik More
Pratik More - avatar
3 Answers
+ 4
If you already understand that there are better ways to write programs, then congratulations, maybe you've done the most difficult part and leaped out of your comfort zone. Now try to understand how those better / faster / less complex solutions work, and build them into your daily coding practice, until they become routine for you.
7th Sep 2020, 4:04 PM
Tibor Santa
Tibor Santa - avatar
+ 2
Thinking on how to approach the problem first. Learning various Data Structures and use them on demand Keep practicing the hard way. And you'll master it day by day.
7th Sep 2020, 5:49 PM
Terminal_Phantom
Terminal_Phantom - avatar
0
Try to think differently....you will get a solution with less time complexity and it will surely come by practice.... So practice a lot and learn new data structures and algorithms... It will help a lot....
7th Sep 2020, 4:02 PM
Ajay Raj Singh Pilkhwal
Ajay Raj Singh Pilkhwal - avatar