LeetCode
0015-3Sum
· ☕ 1 min read

題目如下:

Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.

Notice that the solution set must not contain duplicate triplets.


0175-Combine Two Tables
· ☕ 1 min read

題目如下:

Write a SQL query for a report that provides the following information for each person in the Person table, regardless if there is an address for each of those people:

FirstName, LastName, City, State


0029-Divide Two Integers
· ☕ 1 min read

題目如下:

Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.

Return the quotient after dividing dividend by divisor.

The integer division should truncate toward zero, which means losing its fractional part. For example, truncate(8.345) = 8 and truncate(-2.7335) = -2.


0006-Longest Substring Without Repeating Characters
· ☕ 1 min read

題目如下:

And then read line by line: "PAHNAPLSIIGYIR"

Write the code that will take a string and make this conversion given a number of rows:

string convert(string s, int numRows);

0007-Reverse Integer
· ☕ 1 min read

題目如下:

Given a 32-bit signed integer, reverse digits of an integer.


0002-Add Two Numbers
· ☕ 1 min read

題目如下:

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.

You may assume the two numbers do not contain any leading zero, except the number 0 itself.


0001-Two Sum
· ☕ 1 min read

題目如下:

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 input would have exactly one solution, and you may not use the same element twice.

You can return the answer in any order.