parameters: (self, lo, hi, k)
return_statement: return sorted(range(lo, hi+1), key=power_value)[k-1]
docstring: :type lo: int
          :type hi: int
          :type k: int
          :rtype: int
docstring_summary: :type lo: int
          :type hi: int
          :type k: int
          :rtype: int
docstring_tokens: : type lo : int : type hi : int : type k : int : rtype : int
function: def getKth(self, lo, hi, k):
          """
          :type lo: int
          :type hi: int
          :type k: int
          :rtype: int
          """
          def power_value(x):
              y, result = x, 0
              while x > 1 and x not in Solution2.dp:
                  result += 1
                  if x%2:
                      x = 3*x + 1
                  else:
                      x //= 2
              Solution2.dp[y] = result + (Solution2.dp[x] if x > 1 else 0)
              return Solution2.dp[y], y
          
          return sorted(range(lo, hi+1), key=power_value)[k-1]
function_tokens: def getKth ( self , lo , hi , k ) : def power_value ( x ) : y , result = x , 0 while x > 1 and x not in Solution2 . dp : result += 1 if x % 2 : x = 3 * x + 1 else : x //= 2 Solution2 . dp [ y ] = result + ( Solution2 . dp [ x ] if x > 1 else 0 ) return Solution2 . dp [ y ] , y return sorted ( range ( lo , hi + 1 ) , key = power_value ) [ k - 1 ]