Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
return element occured more than n/3 times
Kali_prasad
Mar 17th, 2022
140
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
C++
0.22 KB
| None
|
0
0
raw
download
clone
embed
print
report
int
Solution
::
repeatedNumber
(
const
vector
<
int
>
&
A
)
{
int
n
=
A.
size
(
)
;
n
/
=
3
;
map
<
int
,
int
>
m
;
for
(
auto
x
:
A
)
{
m
[
x
]
++
;
if
(
m
[
x
]
>
n
)
return
x
;
}
return
-
1
;
}
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
Free Crypto Method
CSS | 1 hour ago | 0.37 KB
Easy Money Method [LEAK]
CSS | 1 hour ago | 0.37 KB
Crypto Exploit
CSS | 1 hour ago | 0.37 KB
Crypto Exploit
Make | 1 hour ago | 0.39 KB
Crypto Exploit
Make | 1 hour ago | 0.39 KB
EARN 5000$ IN 24 HOURS
CSS | 1 hour ago | 0.37 KB
VIP Moneymaking Strategy
CSS | 1 hour ago | 0.37 KB
VIP Moneymaking Strategy
CSS | 1 hour ago | 0.37 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!