/images/avatar.png

lc67. Add Binary

Given two binary strings a and b, return their sum as a binary string. Example 1: 1 2 Input: a = "11", b = "1" Output: "100" Example 2: 1 2 Input: a = "1010", b = "1011" Output: "10101" Constraints: 1 <= a.length, b.length <= 104 a and b consist only of '0' or '1' characters. Each string does not contain leading zeros except for the zero itself. 解题思路 直接按照进位处理即可。

lc273. Integer to English Words

Convert a non-negative integer num to its English words representation. Example 1: 1 2 Input: num = 123 Output: "One Hundred Twenty Three" Example 2: 1 2 Input: num = 12345 Output: "Twelve Thousand Three Hundred Forty Five" Example 3: 1 2 Input: num = 1234567 Output: "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven" Constraints: 0 <= num <= 2^31 - 1 解题思路: 根据数字长度分成不同的翻译位: 亿,百万,千,百,Billion, Million, Thousand, Hundred

lc973. K Closest Points to Origin

Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0). The distance between two points on the X-Y plane is the Euclidean distance (i.e., √(x1 - x2)2 + (y1 - y2)2). You may return the answer in any order. The answer is guaranteed to be unique(except for the order that it is in).