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

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.

9/7/2020 3:49:27 PM

Pratik More

4 Answers

New Answer

+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.

+3

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

+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.

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....