string
string
i. nt times = num/val[i.J;
'" while(times-- ) { . ,
result += sy~[i.J ;
}
}
l: I f!t4:W ,a ,t .+2 ht'::M
int romanToint (:st-ring ._ s') · {-
II
I
_.l,111~1· \ ~ ~ · · 1111
- ~ ' y~CJ~ itti:,:
. .,_ ·; '
. ' ,, . ' .. ~. .'
~-
, I
1
~ .~ f,J7st.<. f Bc~J ~tY(~ J ~'\:-~J()) f IR,, ~
_ .. __ 1,' lrr-~:-
A~:-~f"r' j'frf{ Jr /l It ~
i.nt i. = 0 ;
//hero honge hamare land r jo revrese karenge words ko
int l = 0 ,. r = 0;
int n• = s.length();
• J
whi.le(i < n) {
whi.lQ (i. < n && s[i.J != ' ') { Ii i. ko agar char di.kha to r ko dega and i.++ and r ++
s [I"++] = s [ i. ++] ;
}
i. f ( l •'.;t ~r}" f I 11 r
reverse(s.begi. n()+l, s.begi.n()+r);
l = r;
}
1
i ++ ; fl y eto badht a rahega
}
s = s .substr(0 r -1);
return s;
class Solution {
public :
int maxDepth(string s)
stack<char> st:
i nt result.. =0:
for (char &ch ·:: s)
{
if (cti
_.-?;-
' :'. -
,. ...
.
. .. . - .
-~t
1: ...
' -- .•. ax( result, (int )st. size()):
,
} ' •.;·:
L
· ·re
~.c,
• • ,
•
•
•
.~ • : ' h~,
;
'••
·l ;;.,.
"
~
l •' ' -
~ View km