原题链接:https://oj.leetcode.com/problems/remove-element/
很简单一道题。。。
class Solution {
public:
int removeElement(int A[], int n, int elem) {
int front = 0;
int idx = 0;
whi...
分类:
其他好文 时间:
2015-01-27 18:34:17
阅读次数:
170
原题链接:https://oj.leetcode.com/problems/merge-two-sorted-lists/
这道题用指针的指针实现,做法会非常简单干净。直接上代码
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
*...
分类:
其他好文 时间:
2015-01-27 14:56:08
阅读次数:
109
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'21: Merge Two Sorted Listshttps://oj.leetcode.com/problems/merge-two-sorted-lists/Merge tw...
分类:
编程语言 时间:
2015-01-27 07:03:06
阅读次数:
681
题目连接:http://www.codechef.com/problems/SUBLCM题意:给定一个序列,求最长连续子序列满足LCM(Ai,Ai+1...Aj)=Ai*Ai+1*...*Aj。分析:若要满足LCM(Ai,Ai+1...Aj)=Ai*Ai+1*...*Aj,必须子序列内两两互质(没有...
分类:
其他好文 时间:
2015-01-27 01:51:08
阅读次数:
179
https://oj.leetcode.com/problems/word-break/Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequenc...
分类:
其他好文 时间:
2015-01-26 22:17:51
阅读次数:
173
from numpy import *import timestarttime = time.time()def loadDataSet(): postingList = [['my', 'dog', 'has', 'flea', 'problems',...
分类:
其他好文 时间:
2015-01-26 06:30:47
阅读次数:
235
https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/Say you have an array for which theithelement is the price of a given stock on da...
分类:
其他好文 时间:
2015-01-25 22:12:13
阅读次数:
201
https://oj.leetcode.com/problems/maximum-product-subarray/Find the contiguous subarray within an array (containing at least one number) which has the ...
分类:
其他好文 时间:
2015-01-24 22:38:58
阅读次数:
254
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'19: Remove Nth Node From End of Listhttps://oj.leetcode.com/problems/remove-nth-node-from-...
分类:
编程语言 时间:
2015-01-24 00:28:42
阅读次数:
211
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'20: Valid Parentheseshttps://oj.leetcode.com/problems/valid-parentheses/Given a string con...
分类:
编程语言 时间:
2015-01-24 00:21:16
阅读次数:
364