![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 70
tyjhField
这个作者很懒,什么都没留下…
展开
-
Word Pattern
Given a pattern and a string str, find if str follows the same pattern.Examples:pattern = "abba", str = "dog cat cat dog" should return true.pattern = "abba", str = "dog cat cat fish"原创 2015-10-09 23:18:56 · 1044 阅读 · 0 评论 -
Game of Life
According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970."Given a board with m原创 2015-10-10 00:31:57 · 517 阅读 · 0 评论 -
Contains Duplicate II
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and jis at most k.c原创 2015-10-09 23:23:17 · 364 阅读 · 0 评论 -
Max Points on a Line
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line./** * Definition for a point. * struct Point { * int x; * int y; * Point() : x(0原创 2015-10-11 01:48:47 · 554 阅读 · 0 评论 -
求数组和最大的最长子列
#include <iostream>int maxSubarray(int a[], int size) { if (size <= 0) std::cout << "error array size\n"; int max = 0x80000000; int cur = 0; int start, end; while...原创 2018-09-06 00:04:02 · 253 阅读 · 0 评论