摘要:
1).2sum1.题意:找出数组中和为target的所有数对2.思路:排序数组,然后用两个指针i、j,一前一后,计算两个指针所指内容的和与target的关系,如果小于target,i右移,如果大于,j左移,否则为其中一个解3.时间复杂度:O(nlgn)+O(n)4.空间:O(1)5.代码: v... 阅读全文
摘要:
Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adjac... 阅读全文
摘要:
Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace... 阅读全文