Ugly numbers dp


i used a bottom up approach to calculate the ugly numbers
i am able to calculate upto 850th ugly number but due to constraints of length of array , i am not able to calculate numbers upto 1000th

what can be the solution to this problem ?

https://interviewprep.appliedcourse.com/lecture/2/interview-preparation-course/496/nth-ugly-number/0/free-videos