Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Dec 16th, 2018
88
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.18 KB
| None
|
0
0
raw
download
clone
embed
print
report
S = input()
N = len(S)
sum = 0
count = 0
flg = False
S = S[::-1]
for i in range(N):
if S[i] == 'W':
count += 1
flg = True
elif S[i] == 'B' and flg:
sum += count
print(sum)
Add Comment
Please,
Sign In
to add comment
Public Pastes
Untitled
1 hour ago | 6.70 KB
Untitled
3 hours ago | 5.89 KB
client-main mortar and pestle not working
5 hours ago | 268.99 KB
server-main mortar n pestle not working
5 hours ago | 282.40 KB
Untitled
7 hours ago | 12.69 KB
Untitled
8 hours ago | 7.36 KB
pokemon
9 hours ago | 4.25 KB
Untitled
9 hours ago | 27.26 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!