int_list= list(map(int,str(num))
res = int(''.join(map(int,int_list)))
classSolution:""" @param num: a non-negative intege @return: the maximum valued number """defmaximum_swap(self,num:int) ->int:# Write your code here digits =list(map(int, str(num))) bucket ={x:i for i,x inenumerate(digits)} n =len(digits)for i inrange(n):for j inrange(9, digits[i],-1):if j in bucket and bucket[j]> i: digits[i], digits[bucket[j]]= digits[bucket[j]], digits[i]returnint(''.join(map(str,digits)))return num