摘要:
这个题为《编程珠玑》中提到的算法,解题思路和桶排序/基数排序一样,适用于大量没有重复的数据。 结题思路: 1.遍历整个数据文件,每提取一个数据,在BitMap中对应的位置赋1 2.遍历BitMap的每一位,为1的位置上输出其再BitMap中的坐标 阅读全文
摘要:
Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. Please note that the string 阅读全文
摘要:
Given an 2D board, count how many different battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. Y 阅读全文
摘要:
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
摘要:
首先想到的是走到其中一个链表的尽头,然后把剩余的链表中的值放入写的链表,返回,但是自己写的代码好长。 Python: 阅读全文
摘要:
1. Two SumGiven 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 wou 阅读全文