Easy way explanation Ugly number
\n\n#        analyzation\n\ninitialize\n   ugly[] =  | 1 |\n   i2 =  i3 = i5 = 0;\n\nFirst iteration\n   ugly[1] = Min(ugly[i2]*2, ugly[i3]*3, ugly[i5]*5)\n    
```\n\n#        analyzation\n\ninitialize\n   ugly[] =  | 1 |\n   i2 =  i3 = i5 = 0;\n\nFirst iteration\n   ugly[1] = Min(ugly[i2]*2, ugly[i3]*3, ugly[i5]*5)\n            = Min(2, 3, 5)\n            = 2\n   ugly[] =  | 1 | 2 |\n   i2 = 1,  i3 = i5 = 0  (i2 got incremented ) \n\nSecond iteration\n    ugly[2] = Min(ugly[i2]*2, ugly[i3]*3, ugly[i5]*5)\n             = Min(4, 3, 5)\n             = 3\n    ugly[] =  | 1 | 2 | 3 |\n    i2 = 1,  i3 =  1, i5 = 0  (i3 got incremented ) \n\nThird iteration\n    ugly[3] = Min(ugly[i2]*2, ugly[i3]*3, ugly[i5]*5)\n             = Min(4, 6, 5)\n             = 4\n    ugly[] =  | 1 | 2 | 3 |  4 |\n    i2 = 2,  i3 =  1, i5 = 0  (i2 got incremented )\n\nFourth iteration\n    ugly[4] = Min(ugly[i2]*2, ugly[i3]*3, ugly[i5]*5)\n              = Min(6, 6, 5)\n              = 5\n    ugly[] =  | 1 | 2 | 3 |  4 | 5 |\n    i2 = 2,  i3 =  1, i5 = 1  (i5 got incremented )\n\nFifth iteration\n    ugly[4] = Min(ugly[i2]*2, ugly[i3]*3, ugly[i5]*5)\n              = Min(6, 6, 10)\n              = 6\n    ugly[] =  | 1 | 2 | 3 |  4 | 5 | 6 |\n    i2 = 3,  i3 =  2, i5 = 1  (i2 and i3 got incremented )\n\nWill continue same way till I < n+1\n\n\n```\n\n```\n#. Algorithm\n\n1 Declare an array for ugly numbers:  ugly[n]\n2 Initialize first ugly no:  ugly[0] = 1\n3 Initialize three array index variables x, y, z to point to \n   1st element of the ugly array: \n        x = y = z=0; \n5 Now go in a loop to fill all ugly numbers till n+1:\nFor  i =0 to n+1\n{\n    d.append(min(d[x]*2,d[y]*3,d[z]*5))\n\t\n          m=d[-1]   #next ugly number\n\t\t  \n          if m==d[x]*2:\n\t\t  #if ugly number ===next ugly number then increase pointer\n            x=x+1\n\t\t\t\n          if m==d[y]*3:\n            y=y+1\n            \n          if m==d[z]*5:\n            z=z+1\n            \n        return d[n-1]\n\n    \n6.return next_ugly_no\n\n\n\n```\n\n\n```\n\n#python code\n\n        d=[1]\n        x,y,z=0,0,0\n        for i in range(n+1):\n          d.append(min(d[x]*2,d[y]*3,d[z]*5))\n          m=d[-1]\n          if m==d[x]*2:\n            x=x+1\n          if m==d[y]*3:\n            y=y+1\n            \n          if m==d[z]*5:\n            z=z+1\n            \n        return d[n-1]\n          \n        \n\n\n\n```
['Python', 'Python3']