How can I make my code less complex? | Sololearn: Learn to code for FREE!


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.

9/7/2020 3:49:27 PM

Pratik More

4 Answers

New Answer


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.


Pratik More By practicing & learning new ways of Programming Like some people use conventional ways to write a code & some of them use functions instead


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.


Try to think 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....