kanak22 / CP-DSA-Questions

This is a repository entirely dedicated to all kind of questions ranging from basic DSA to CP. It aims to provide a solution to different questions. 📚
73 stars 128 forks source link

Updated the Ugly Number problem in java reducing the memory #576

Closed Sxmxrth closed 2 years ago

Sxmxrth commented 2 years ago

Related Issue

Closes: #[issue number that will be closed through this PR]

Updated condition and added one condition.

I have updated the first condition from if(<=0) to if(<1), and added the condition if(n==2 || n==3|| n==5)

Mention any unusual behavior of your code (Write NA if not)

N/A

Checklist:

(To mark, write x inside the square brackets like this: [x])

Additional Info (optional)

The memory taken has been reduced from 42 MB to 39.7 MB.

kanak22 commented 2 years ago

Hello @Sxmxrth this PR is linked with which issue?