題目:
Table: Person
Person
+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+-------------+---------+PersonId is…
Table: SalesPerson
SalesPerson
+-----------------+---------+| Column Name | Type |+-----------------+---------+| sales_id | int || name | varchar || salary | int || commission_rate | int || hire_date | date |…
Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function).
myAtoi(string s)
atoi
The algorithm for myAtoi(string s) is as follows:
Given two integers a and b, return the sum of the two integers without using the operators + and -.
a
b
+
-
Example 1:
Input: a = 1, b = 2Output: 3
Example 2:
Input: a = 2, b = 3Output: 5
Input: l1 = [1,2,4], l2 = [1,3,4]Output: [1,1,2,3,4,4]
連接兩個List,數字由小至大。
思路:
1. l1,l2資料結構是ListNode
給兩個表,一個顧客名子,一個有買東西的顧客的名單,接著求列出沒買東西的人的名單。
Table: Customers.
Customers
+----+-------+| Id | Name |+----+-------+| 1 | Joe || 2 | Henry || 3 | Sam || 4 | Max |…
Implement pow(x, n), which calculates x raised to the power n (i.e., xn).
x
n
xn
Input: x = 2.00000, n = 10Output: 1024.00000
Input: x = 2.10000, n = 3Output: 9.26100
Table: Employees
Employees
+-------------+---------+| Column Name | Type |+-------------+---------+| employee_id | int || name | varchar || salary | int |+-------------+---------+employee_id is the primary key for this table.Each…
列出各Department 中Salary 前三高的名單。
The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id.
Employee
+-------------+---------+| Column Name | Type |+-------------+---------+| employee_id | int || name | varchar |+-------------+---------+employee_id is the primary key for this table.Each row of…