堆 from heapq import heappop, heappushclass Solution:def nthUglyNumber(self, n):q = [1]vis = {1}for _ in range(n - 1):now = heappop(q)for i in [2, 3, 5]:if now * i not in vis:vis.add(now * i)heappush(
题目内容 https://www.nowcoder.com/practice/6aa9e04fc3794f68acf8778237ba065b?tpId=13&tqId=11186&tPage=2&rp=2&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking 把只包含质因子2、3和5的数称作丑数(Ugly Nu