摘要:
Tic-tac-toe is played by two players A and B on a 3 x 3 grid. Here are the rules of Tic-Tac-Toe: Players take turns placing characters into empty squa 阅读全文
摘要:
You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight 阅读全文
摘要:
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
摘要:
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra spa 阅读全文
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
摘要:
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. Y 阅读全文
摘要:
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. 给n个不同的数,求0-n这n+1个数里缺了哪个 利用异或运算的性 阅读全文
摘要:
Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. pascal 三角形 a[i][j] = a[i - 1][j - 1] + a[i - 1][j] class Soluti 阅读全文