由买买提看人间百态

topics

全部话题 - 话题: parenthesis
1 2 3 下页 末页 (共3页)
g****y
发帖数: 240
1
来自主题: JobHunting版 - 问个括号问题的迭代解法
def print_valid_parenthese_iterative(n):
stack = []
result = [] # current result
# each tuple in the stack contains three items:
# first item: number of left parenthesis remaining
# second item: number of right parenthesis remaing
# third item: the parenthesis that should add to the
# result when this tuple is popped
stack.append((n - 1, n, '('))
while stack:
left, right, parenthesis = stack.pop()
result.append(parenthesis)
# if no more... 阅读全帖
m**********e
发帖数: 22
2
我来贡献一个用queue的方法。C#写的:
// Iterative approach
public List generateParenthesisIter(int n)
{
Queue queue = new Queue(
);
queue.Enqueue(new ParenthesisWrapper("",0,0));
List result = new List();
while (queue.Count > 0)
{
ParenthesisWrapper curr = queue.Dequeue();
if (curr.left == n)
{
if ... 阅读全帖
o****p
发帖数: 162
3
来自主题: _FunctionalProgramming版 - 就FP而言lisp是不是已经很完美了,不说纯不纯
If you are only pissed off by parenthesis in Lisp, well, that's not a big
problem at all. In emacs, which you seem to know well, you can easily set up
parenthesis match (online mode) during your coding. Whenever you put your
cursor at any (left or right) parenthesis, you will see the matched pair
parenthesis (right or left) highlighted. Once you get used to it, you almost
forgot about the issue of matching parenthesis.
Yes, Lisp is the most wonderful language I have ever used. You can do OO (
re
o****p
发帖数: 162
4
来自主题: _FunctionalProgramming版 - 就FP而言lisp是不是已经很完美了,不说纯不纯
If you are only pissed off by parenthesis in Lisp, well, that's not a big
problem at all. In emacs, which you seem to know well, you can easily set up
parenthesis match (online mode) during your coding. Whenever you put your
cursor at any (left or right) parenthesis, you will see the matched pair
parenthesis (right or left) highlighted. Once you get used to it, you almost
forgot about the issue of matching parenthesis.
Yes, Lisp is the most wonderful language I have ever used. You can do OO (
re... 阅读全帖
i**********e
发帖数: 1145
5
来自主题: JobHunting版 - 请问一道很难的面试题
There are only 5 different kinds of expressions with different arrangement
of parenthesis for 4 numbers (using an example of 1,2,3,4), shown as below:
1) ((1 + 2) + (3 + 4))
2) (((1 + 2) + 3) + 4)
3) ((1 + (2 + 3)) + 4)
4) (1 + ((2 + 3) + 4))
5) (1 + (2 + (3 + 4)))
An easy way is to brute force using recursive method. Choose all possible
neighboring pairs and merge them using the operators (add, subtract...). For
example, choosing neighboring pairs of (1 and 2):
(1 + 2) + 3 + 4 --> 3 + 3 + 4
... 阅读全帖
s***0
发帖数: 117
6
来自主题: JobHunting版 - 问个括号问题的迭代解法
#include
#include
#include
#include
#include
using namespace std;
class ProcessParen
{
public:
ProcessParen(){};
void processString(string& inString)
{
stack charStack;
for (int i = 0; i< inString.length(); ++i)
{
if(inString[i] == '{')
{
mResult += "{";
charStack.push('{');
}
if(inString[i] == '}')
{
... 阅读全帖
e****e
发帖数: 418
7
来自主题: JobHunting版 - M家
Use an array. add the left parenthesis position(number) into array, if
encountering the right parenthesis, output the last array element and the
right parenthesis position. The pointer to last array element also left
shift by one. The way this array used is very similar to the stack.
m**o
发帖数: 846
8
看到一个牛的
Decision: Accepted
Objective:
SAT I (breakdown): 1910 (CR - 600, Math - 670, Writing - 640)
ACT: N/A
SAT II: Chemistry - 680, Math I - 690
Unweighted GPA (out of 4.0): 3.53
Rank (percentile if rank is unavailable): N/A
AP (place score in parenthesis): N/A
IB (place score in parenthesis): N/A
Senior Year Course Load: Advanced Biology, Intermediate Orchestra, AP
English Literature and Composition, Advanced US History, Accelerated Algebra
II, Introductory Economics
Major Awards (USAMO, Intel... 阅读全帖
b**j
发帖数: 20742
9
来自主题: Football版 - 我也来劝逻辑真的应该考虑出书
我靠,这tmd也被哈佛据了。
Decision: Rejected
Objective:
SAT I (breakdown): 2400
ACT: didn't take
SAT II: 800 Math II, 800 Chinese, 790 Chemistry
Unweighted GPA (out of 4.0): 4.74 weighted, no unweighted
Rank (percentile if rank is unavailable): no rank
AP (place score in parenthesis): Chem (5), Bio (5), Calc (5), US (5), Psycho
logy (5), Euro (5)
IB (place score in parenthesis):
Senior Year Course Load: Calc 3, AP Econ, AP Comp Sci, AP Lit, AP Gov, AP Ph
ysics
Major Awards (USAMO, Intel etc.): none
Subject... 阅读全帖
M*****a
发帖数: 7122
10
来自主题: Football版 - 我也来劝逻辑真的应该考虑出书
结论下的早了,再看看这个,笑死了快
Decision: Accepted
Objective:
SAT I (breakdown): 1910 (CR - 600, Math - 670, Writing - 640)
ACT: N/A
SAT II: Chemistry - 680, Math I - 690
Unweighted GPA (out of 4.0): 3.53
Rank (percentile if rank is unavailable): N/A
AP (place score in parenthesis): N/A
IB (place score in parenthesis): N/A
Senior Year Course Load: Advanced Biology, Intermediate Orchestra, AP
English Literature and Composition, Advanced US History, Accelerated Algebra
II, Introductory Economics
Major Awards (U... 阅读全帖
G****e
发帖数: 487
11
呵呵,我还真没多少经验可谈,不想误导大家。实事求是地说,是孩子自己比较好,说
来惭愧,我自己在孩子身上没下太多功夫。比如这次写essay,early action的essay我
只是大概看了一下,一点都没改。Early action的MIT的essay我是到交上去才看得。看
完了觉得写得不太好,不过已经没法改了。而且她给她的college counselor 看过了,
后者所没啥问题。后来MIT EA 被defer了我才认真地帮她看了其它学校的申请essay.
她其实也不是很认真的人。有两个小插曲,一个是她申请的时候common application的
Social Security number都填错了,以至于现在Harvard的financial aid都没搞定。还
有一个是申请材料差点没有及时交上去。所有申请是通过一个commonapp.org的网站提
交的。她先把材料填好,我检查一遍,然后我用信用卡付申请费,付完了还要回到另一
页submit才算完成。她只叫我付费,我付完了以为就行了(缺了最后一步),她也没来
检查(这些孩子递出申请后就不想再看第二遍了)。截止日是12/31,... 阅读全帖
p****s
发帖数: 3184
12

(defun match-paren (arg)
"Go to the matching parenthesis if on parenthesis otherwise insert %."
(interactive "p")
(cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
((looking-at "\\s\)") (forward-char 1) (backward-list 1))
(t (self-insert-command (or arg 1)))))
(global-set-key "%" 'match-paren)
; however, now you have to press C-q % if you want to insert a %
; when the cursor is at a parenthesis
s*****n
发帖数: 994
13
来自主题: JobHunting版 - one facebook software problem
Implement a function string balanceParanthesis(string s); which given a
string s consisting of some parenthesis returns a string s1 in which
parenthesis are balanced and differences between s and s1 are minimum.
Eg - "(ab(xy)u)2)" -> "(ab(xy)u)2"
")))(((" -> ""
Is my idea correct:?
void eliminate (int left[], int right[],leftsize, rightsize)//in left right
there are position info. left[0] is the position of first left paranthesis
{
sort (left, left+leftsize);
sort (right, right+rightsize);
... 阅读全帖
s*****n
发帖数: 994
14
来自主题: JobHunting版 - one facebook software problem
Implement a function string balanceParanthesis(string s); which given a
string s consisting of some parenthesis returns a string s1 in which
parenthesis are balanced and differences between s and s1 are minimum.
Eg - "(ab(xy)u)2)" -> "(ab(xy)u)2"
")))(((" -> ""
Is my idea correct:?
void eliminate (int left[], int right[],leftsize, rightsize)//in left right
there are position info. left[0] is the position of first left paranthesis
{
sort (left, left+leftsize);
sort (right, right+rightsize);
... 阅读全帖
s*******f
发帖数: 1114
15
来自主题: JobHunting版 - one facebook software problem
//Implement a function string balanceParanthesis(string s); which given a
//string s consisting of some parenthesis returns a string s1 in which
//parenthesis are balanced and differences between s and s1 are minimum.
//Eg - "(ab(xy)u)2)" -> "(ab(xy)u)2"
//")))(((" -> ""
void DelBrackets(char *str){
if (!str)
return;
deque sc;
deque sp;
char *p = str;
while (*p){
if (*p == '('){
sc.push_back('(');
sp.push_back(p);
}... 阅读全帖
x*******7
发帖数: 223
16
来自主题: JobHunting版 - fb面试题【转】
不知道发过没,在其他地方看到的。
Implement a function
char* readLine();
which returns single lines from a buffer. To read the buffer, you can makes
use of a function
int read(char* buf, int len)
which fills buf with upto len chars and returns the actual number of chars
filled in. Function readLine can be called as many times as desired. If
there is no valid data or newline terminated string available, it must block
. In order to block, it can use read function which in turn will block when
it doesn't have anyth... 阅读全帖
k***t
发帖数: 276
17
谁写了?或有没有好一些的online的参考答案?
用于对照检查自己写的是否全面。谢谢。
发信人: xicheng17 (super), 信区: JobHunting
标 题: fb面试题【转】
发信站: BBS 未名空间站 (Wed Nov 9 20:42:44 2011, 美东)
不知道发过没,在其他地方看到的。
Implement a function
char* readLine();
which returns single lines from a buffer. To read the buffer, you can makes
use of a function
int read(char* buf, int len)
which fills buf with upto len chars and returns the actual number of chars
filled in. Function readLine can be called as many times as desired. If
there is no valid data or newl... 阅读全帖
I*********e
发帖数: 61
18
来自主题: JobHunting版 - 问个括号问题的迭代解法
感激,但下面沒看懂:
# if no more parenthesis left, print the result
if left == 0 and right == 0:
print("".join(result))
# here we should restore the result to the last valid state
# by checking the current top element in the stack.
if stack:
left, right, parenthesis = stack[-1]
result = result[: 2 * n - left - right - 1]
如何理解?
g*******n
发帖数: 214
19
来自主题: JobHunting版 - 弱问一道c++语法题
是那道打印括号的题目:addValidParenthesis是一个另一个函数,返回的结果是正确
的,因为我不用指针的话(如下面代码)是可以答应出来的。
vector Parenthesis::generateParenthesis(int n){
vector list;
addValidParenthesis(n-1, n, &list, "(");
/*cout< for(int i=0;i cout< }
cout< return list;
}
但是如果改为vector* 返回类型,并且上面代码只修改为return &list。在外
面用
vector* result = Parenthesis::generateParenthesis(3);
用 cout << (*result)[0] << endl;是打印不出来东西
请... 阅读全帖
s******7
发帖数: 1758
20
来自主题: JobHunting版 - G家onsite面经
6轮, 5 coding +1 design
等了两个星期,最后还是挂了,安慰奖说可以送到 staff, engineer冻上了,本来就是
改行过来的,再改去当男秘书,PM,HR
4,5都是国人,很nice,聊了不少天
题都不难,但是做出来也未必过,recruiter 反映最后一轮design negative
1. validate parenthesis, generate all possible valid parenthesis, 只有(),
不需要用stack, 一个int count就够了
2. regular expression match,只有*,代表任意个任何字符, 我用二维dp,面试官
好像不倾向dp, 估计recursion会讨喜点
3. max product of two string without sharing common character, 很多优化,先
写brute force,注意判断两个字符串有没有重复字符用一个26位的整数(bit map)会
优化很多
4. max number of time range overlaps, 要求返... 阅读全帖
m****i
发帖数: 1076
21
来自主题: MusicPlayer版 - Blues Lesson (1)[转载]
Lesson: 1
Title: BASIC BLUES
Level: Beginner (+Intermediate)
Style: 12-bar Blues, theory
Instructor: Olav Torvund
[Editor's note - Olav is sending us this lesson for Norway. Some of
the musical terms he is using are spelled slightly differently from the
way they are spelled in the U.S. (they are probably closer to the Latin
than English allows) Wherever these spelling differences occur, I
have added the U.S. English equivalent initially, but have left them
in their original spelling thro... 阅读全帖
J*****s
发帖数: 185
22
来自主题: EnglishChat版 - 标点符号读法
! exclamation point Wow, Bang.
@ At, Spiral
# octothorp hash, pound, gridlet
mesh, number sign
$ dollar sign, anything else?
% percent sign double-oh-seven
^ caret, roof hat
& ampersand AND
* asterisk splat, star, rienhold
( left parenthesis open
) right parenthesis close
- en dash
hyphen, minus, dash, worm (!)
_ underscore floor, bimmin
T******7
发帖数: 1419
23
clojure 是lisp, 是好语言,但一辈子是小众,火不起来
parenthesis with parenthesis,,,no a lot of people can read it,
not a lot of people want to spend long time working on it this kinda
language..

发帖数: 1
24
12月 谈谈间谍问题
我一直感觉Reuters 有日本的间谍,他们会通过报道来传递针对华人屠杀的计划,和发
布不利于华人的报道,制造舆论。最重要他们后边的势力和犯罪集团有关。有必要好好
调查这个组织。
How top U.S. colleges hooked up with controversial Chinese companies
By Steve Stecklow and Alexandra Harney
Filed Dec. 2, 2016, noon GMT
New Oriental, China’s biggest private educator, has been accused of
academic fraud. Thanks to two enterprising Americans, it has also gained
access to leading U.S. college admissions officers.
SHANGHAI/SHELTER ISLAND, New York - Thomas Benson once ran a small... 阅读全帖
C*I
发帖数: 4736
25
一直在误导,现在还在误导。 说说明corona virus 不可以从蝙蝠直接传染给人,必须
经过一个中间宿体性的其它动物才能传染给人。所以,病毒发生后,就故意误导全国人
民去海鲜市场找证据,找其它野生动物的麻烦。 而且还是病毒所去找的,找完了还装
模做样化验呀,分离呀什么的。最后把责任全部推给了海鲜市场的动物。可是那种动物
,一直不敢说,说了其它相关已经在人就会去早那种动物监测。 所以压根不说,打马
虎眼。
事实上,早在2013 年,就是这个武汉病毒研究所,已经从来自云南的蝙蝠身上所携带
的corona virus中分离出第一株蝙蝠SARS类似样的冠状病毒的活病毒,其中就包含了类
似于S类型的基因。从而证实这株病毒能够使其接受和SARS病毒相同的受体,并能够感
染人的细胞。对此新发现,武汉病毒所还把它以武汉病毒研究所的英文简称命名“WIV1
”,以彰显这一发现的重要价值和属于自己第一个发现的巨大研究成果。这个成果刊载
于2013年11月的《自然》杂志。
就是说,从云南弄回来的这种蝙蝠所携带的类似于sars的 corona virus, 可以不经过
其它受体/宿体,而直接传染给人。 他们... 阅读全帖
C*I
发帖数: 4736
26
一直在误导,现在还在误导。 说说明corona virus 不可以从蝙蝠直接传染给人,必须
经过一个中间宿体性的其它动物才能传染给人。所以,病毒发生后,就故意误导全国人
民去海鲜市场找证据,找其它野生动物的麻烦。 而且还是病毒所去找的,找完了还装
模做样化验呀,分离呀什么的。最后把责任全部推给了海鲜市场的动物。可是那种动物
,一直不敢说,说了其它相关已经在人就会去早那种动物监测。 所以压根不说,打马
虎眼。
事实上,早在2013 年,就是这个武汉病毒研究所,已经从来自云南的蝙蝠身上所携带
的corona virus中分离出第一株蝙蝠SARS类似样的冠状病毒的活病毒,其中就包含了类
似于S类型的基因。从而证实这株病毒能够使其接受和SARS病毒相同的受体,并能够感
染人的细胞。对此新发现,武汉病毒所还把它以武汉病毒研究所的英文简称命名“WIV1
”,以彰显这一发现的重要价值和属于自己第一个发现的巨大研究成果。这个成果刊载
于2013年11月的《自然》杂志。
就是说,从云南弄回来的这种蝙蝠所携带的类似于sars的 corona virus, 可以不经过
其它受体/宿体,而直接传染给人。 他们... 阅读全帖
C*I
发帖数: 4736
27
Published: 30 October 2013
Isolation and characterization of a bat SARS-like coronavirus that uses the
ACE2 receptor
Xing-Yi Ge, Jia-Lu Li, Xing-Lou Yang, Aleksei A. Chmura, Guangjian Zhu,
Jonathan H. Epstein, Jonna K. Mazet, Ben Hu, Wei Zhang, Cheng Peng, Yu-Ji
Zhang, Chu-Ming Luo, Bing Tan, Ning Wang, Yan Zhu, Gary Crameri, Shu-Yi
Zhang, Lin-Fa Wang, Peter Daszak & Zheng-Li Shi
Nature volume 503, pages535–538(2013)Cite this article
Abstract
The 2002–3 pandemic caused by severe acute respirator... 阅读全帖
l****z
发帖数: 29846
28
http://www.newsrealblog.com/2010/11/28/cronkiting-north-korea-wont-work-this-time-hes-dead-and-were-not-buying-it/
Cronkiting North Korea Won’t Work This Time; He’s dead, and we’re not
buying it
Posted By Resa Kirkland On November 28, 2010 @ 11:00 am In Agendas of the
Left,Anti-War Movement,Asia,Big Government,Big Posts,Corruption,Defining the
Left,Feature,Hot Posts,Media: Leftwing Bias,Military & Defense Issues,
Political Correctness,Political News,Politics,Tactics of the Left,Terrorism
(Non-Is... 阅读全帖
c********i
发帖数: 1489
29
来自主题: USANews版 - 希拉里必将成为下任总统
https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q
=William+Branham
Vision Six:
Then there arose in the United States a most beautiful woman clothed in
splendor, and great power was given to her. She was lovely of feature but
there was a hardness about her that defied description. Beautiful as she was
, she was yet cruel, wicked and cunning. She dominated the land with her
authority, she had complete power over the people. The vision indicated that
either such a woman w... 阅读全帖
J*******3
发帖数: 1651
30
丰田2013年6月6日公开了预计将于年内作为2014年款投放市场的新一代“卡罗拉”(北
美版)的概要,价格及详细性能指标将在临近上市时发布。
这是第11代卡罗拉,为了吸引更年轻的用户而非维持以往用户,继“Avalon”
及“RAV4”之后,丰田再次采用了个性强烈的外观设计。前脸以较扁的前大灯以及下部
带大开口的保险杠等为特点,并搭配大幅膨出的翼子板以及向后平缓下滑的C柱。
新款卡罗拉的外形尺寸为长4639×宽1776×高1455mm,与上代车型相比车长增
加99mm,车宽扩大16mm,但车高降低10mm。轴距为2700mm,比上代车型长100mm。由于
轴距更长,因此后座臀点后移了75mm,另外还通过减薄前座靠背,使后座乘坐空间变得
宽敞。

图2:“LE Eco”的后视图 (点击放大)
图3:侧视图 (点击放大)

图4:LE Eco的内装 (点击放大)
图5:S的内装 (点击放大)
新一代卡罗拉设有“L”、“LE”、“S”和“LE Eco”四种级别。前三个级别
的款... 阅读全帖
c**i
发帖数: 6973
31
来自主题: Family版 - A Taiwanese woman to marry herself
Taiwanese woman to marry herself; A Taiwanese woman has decided to marry
herself in an elaborate ceremony due to a lack of potential suitors.
Telegraph (London), Oct. 22, 2010.
http://www.telegraph.co.uk/news/worldnews/asia/taiwan/8080685/Taiwanese-woman-to-marry-herself.html
Note:
(1) CHEN Wei-yih 陳薇伊
(2)
(a) 張錦弘, 嫁給自己! 享受「一個人的婚禮」. United Daily News (UDN), Oct.,
18, 2010.
http://udn.com/NEWS/NATIONAL/NAT5/5916692.shtml
These are all Japanese terms, except the first one, which is dedrived from
J... 阅读全帖
p*******m
发帖数: 20761
32
Review of the Xiaomi Hybrid Earphones: Xiaomi have done it again
By Steven Johns · 2 hours ago 4
Xiaomi has generally received praise for their headphones and, over the last
few years, have released four generations with each building on the last.
Starting with the original pair that didn't get too much attention, through
to the second generation which some considered to have been re-defining "
Budget-Fi" by providing a lot of bang for very little buck. The Xiaomi
Piston 2 was very V-shaped, how... 阅读全帖
G******y
发帖数: 1831
33
round braket (or parenthesis), square braket, curly braket, caret (or raise
to the power of)
在左边加left, 右边加right, 例如left round braket
b***e
发帖数: 1419
34
来自主题: JobHunting版 - 大家看看这道题code怎么写
This is a simple parsing/pretty printing problem. First parse the given
string to an abstract syntax tree, then recurse the tree structure and
apply a straightforward pretty printing algorithm: for each internal node
(representing a binary operator), if its precedence is lower than the
precedence of its parent node, then print surrounding parenthesis.
s*********t
发帖数: 1663
35
来自主题: JobHunting版 - 请教个C题目
果然
编译器说suggest parenthesis around &
还是加括号吧
这种题目毫无意义,没人这么写程序
x***y
发帖数: 633
36
来自主题: JobHunting版 - 请教一道 Google 面试题
If we treat the operations of k 1 and followed by 2+3+4 as a group, then after each group of operations, the problem becomes
A*=(A...A) (totally k A in parenthesis)
1. Ctrl+V will type another A*
2. Ctrl+A Ctrl+C Ctrl+V
if we treat A* as the new unit, it will become the original problem again. So, we can use DP to work on it
F(N) = max_{0<=k<=N} { k+k*F(N-k-3)}
with F(0)=F(-1)=F(-2)=F(-3)=0.

please
q****x
发帖数: 7404
37
来自主题: JobHunting版 - ASCII字符发音总结
听说变态的Amazon要人念code,总结了一个。
这里面叹号和圆括号单词音节有点长,也有点绕口。我个人倾向用bang和round
bracket。但bang似乎不常见。
! exclamation mark, bang
" double quote
# pound, sharp
$ dollar
% percent
& ampersand, reference
' single quote
( left/opening parenthesis/round bracket
) right/closing
[ left/opening bracket/square bracket
] right/closing
{ left/opening brace/curly bracket
} right/closing
< less
> greater
* star
+ plus
, comma
- dash, minus
. dot
/ slash
\ back... 阅读全帖
t****t
发帖数: 6806
38
来自主题: JobHunting版 - 今天做题发现了一个很不明显的bug
for gcc, use "-ansi -pedantic-errors -Werror", this will be rejected. it
will force you to add parenthesis for shift and plus/minus.
i always do this for anything longer than 20 lines.
G******i
发帖数: 5226
39
来自主题: JobHunting版 - [合集] ASCII字符发音总结
☆─────────────────────────────────────☆
quantx (X矿工) 于 (Wed Nov 9 17:30:25 2011, 美东) 提到:
听说变态的Amazon要人念code,总结了一个。
这里面叹号和圆括号单词音节有点长,也有点绕口。我个人倾向用bang和round
bracket。但bang似乎不常见。
! exclamation mark, bang
" double quote
# pound, sharp
$ dollar
% percent
& ampersand, reference
' single quote
( left/opening parenthesis/round bracket
) right/closing
[ left/opening bracket/square bracket
] right/closing
{ left/opening brace/curly bracket
} right/closing
< ... 阅读全帖
w****x
发帖数: 2483
40
来自主题: JobHunting版 - 贴一个OJ 的 longest valid parenthesis
int longestValidParentheses(string s) {
const char* str = s.c_str();

int nMax = 0;

const char* p = str;
stack stk;
while (*p != 0)
{
if (*p == '(')
stk.push(p);
else if (*p == ')')
{
if (!stk.empty() && *stk.top() == '(')
{
stk.pop();
nMax = max(p - (stk.empty() ? str-1 : stk.top()), nMax);
... 阅读全帖
s********0
发帖数: 34
41
来自主题: JobHunting版 - 贴一个OJ 的 longest valid parenthesis
赞~有点dp的味道
a*******y
发帖数: 1040
42
来自主题: JobHunting版 - 贴一个OJ 的 longest valid parenthesis
这个str -1 还是有可能越界的吧,是不是改成p-str +1合适点
w****x
发帖数: 2483
43
来自主题: JobHunting版 - 贴一个OJ 的 longest valid parenthesis

过了OJ啊
a*******y
发帖数: 1040
44
来自主题: JobHunting版 - 贴一个OJ 的 longest valid parenthesis
什么意思?OJ是啥?
C*******n
发帖数: 49
45
来自主题: JobHunting版 - 贴一个OJ 的 longest valid parenthesis
从左到右扫一边,再从右到左扫一边,O(n) time O(1) space
h****n
发帖数: 1093
46
来自主题: JobHunting版 - leetcoede新题Valid Palindrome
看错题了,以为是那个valid parenthesis pair
惭愧
w**********o
发帖数: 140
j******2
发帖数: 362
48
题不难,但是只会recursive解,有没有大牛给个iterative解啊?谢了。
p*****2
发帖数: 21240
49
n bits?
j******2
发帖数: 362
50
就是n对,产生各种valid的组合那道,leetcode的
1 2 3 下页 末页 (共3页)