Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range...
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each...
You are given a string s. Your task is to remove all digits by doing this operation repeatedly: Delete the first digit and the closest non-digit...
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next =...
def solve(x, n): if x == 0: return 0 lower = 0 upper = max(1, x) mid = (lower + upper) / 2 while ((mid-lower) >= 0.001): ...