I have recently started to attend the online coding contest. Leetcode has held weekly contests on Sunday early mornings - which isn't ideal for coders living in Europe. However, they have biweekly contests, which is run the Sat 3:30 to 5:30 (BST) every two weeks. Today's contest: https://leetcode.com/contest/biweekly-contest-31 I have managed to solve 3 puzzles in 30 minutes, however, failed to solve the fourth puzzle (difficulty level) in next hour. The programming language I choose is C++. I have 2 Wrong Answer submission for Problem 2 - which adds total 10 minutes time penalization. ![image.png](https://cdn.steemitimages.com/DQmSYHXx4SCNu39BC8HovjteMYc5FF6s3DFys2iL9XcVPHz/image.png) The fourth puzzle is not that difficult - it is a pity that I didn't get it - and my ranking is expected to drop. ## Count Odd Numbers in an Interval Range https://leetcode.com/contest/biweekly-contest-31/problems/count-odd-numbers-in-an-interval-range Easy Math, we can simplify the problem by adjusting the low/high acordingly. For example, when low is even, we can increment the low and the result will be the same. ## Number of Sub-arrays With Odd Sum https://leetcode.com/contest/biweekly-contest-31/problems/number-of-sub-arrays-with-odd-sum/ Dynamic Programming or Prefix Sum. Count the even sum or odd sum and add them. ## Number of Good Ways to Split a String https://leetcode.com/contest/biweekly-contest-31/problems/number-of-good-ways-to-split-a-string/ Use two arrays to store the number of occurencies for each character. There are O(N) ways to split a string. ## Minimum Number of Increments on Subarrays to Form a Target Array https://leetcode.com/contest/biweekly-contest-31/problems/minimum-number-of-increments-on-subarrays-to-form-a-target-array/ Accumulate the difference between neigbour numbers, this can be done in O(N), four lines of code. I'll share the solutions on the [blog](https://helloacm.com) in more details soon. Although the contest has ended, you can try to participate on the virtual contest. <hr/> Every little helps! I hope this helps! **Steem On!~** ------------------ If you like my work, please consider voting for me, thanks! https://steemit.com/~witnesses type in **justyy** and click ***VOTE*** https://steemyy.com/images/vote-for-justyy.jpg <BR/> **Alternatively, you could [proxy to me](https://steemyy.com/witness-voting/?witness=justyy&action=proxy) if you are too lazy to vote!** Also: you can vote me at the tool I made: https://steemyy.com/witness-voting/?witness=justyy ### Visit me at: [https://steemyy.com](https://steemyy.com)
post_id | 86,833,219 |
---|---|
author | justyy |
permlink | leetcode-biweekly-contest-31 |
category | witness-category |
json_metadata | {"tags":["witness-category","programming","whalepower","algorithms","coding","leetcode","contest","codeonsteem"],"image":["https:\/\/cdn.steemitimages.com\/DQmSYHXx4SCNu39BC8HovjteMYc5FF6s3DFys2iL9XcVPHz\/image.png","https:\/\/steemyy.com\/images\/vote-for-justyy.jpg"],"links":["https:\/\/leetcode.com\/contest\/biweekly-contest-31","https:\/\/leetcode.com\/contest\/biweekly-contest-31\/problems\/count-odd-numbers-in-an-interval-range","https:\/\/leetcode.com\/contest\/biweekly-contest-31\/problems\/number-of-sub-arrays-with-odd-sum\/","https:\/\/leetcode.com\/contest\/biweekly-contest-31\/problems\/number-of-good-ways-to-split-a-string\/","https:\/\/leetcode.com\/contest\/biweekly-contest-31\/problems\/minimum-number-of-increments-on-subarrays-to-form-a-target-array\/","https:\/\/helloacm.com","https:\/\/steemit.com\/~witnesses","https:\/\/steemyy.com\/witness-voting\/?witness=justyy&action=proxy","https:\/\/steemyy.com\/witness-voting\/?witness=justyy","https:\/\/steemyy.com"],"app":"steemit\/0.2","format":"markdown"} |
created | 2020-07-25 17:15:12 |
last_update | 2020-07-25 17:15:12 |
depth | 0 |
children | 0 |
net_rshares | 32,240,007,438,331 |
last_payout | 2020-08-01 17:15:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 10.838 SBD |
curator_payout_value | 9.905 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 2,602 |
author_reputation | 2,057,469,156,047,835 |
root_title | "Leetcode Biweekly Contest 31" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
gerber | 0 | 5,770,961,038 | 1.2% | ||
ezzy | 0 | 79,129,587,088 | 1.2% | ||
exyle | 0 | 118,137,876,132 | 1.2% | ||
ace108 | 0 | 203,289,742,485 | 17% | ||
jphamer1 | 0 | 4,170,303,348,148 | 100% | ||
shanghaipreneur | 0 | 360,678,352 | 100% | ||
justyy | 0 | 23,119,230,889,453 | 100% | ||
happyukgo | 0 | 16,084,717,617 | 100% | ||
nokeh | 0 | 213,241,952 | 100% | ||
fleur | 0 | 32,976,082,426 | 100% | ||
skepticology | 0 | 1,765,058,734 | 100% | ||
techken | 0 | 47,677,973,325 | 100% | ||
doraemon | 0 | 251,384,393 | 100% | ||
robinlee | 0 | 492,533,500 | 100% | ||
dine77 | 0 | 47,108,532,411 | 6.5% | ||
rainyapril | 0 | 503,926,846 | 100% | ||
khalil319 | 0 | 293,884,576 | 10% | ||
al2ping | 0 | 58,331,173 | 100% | ||
chetanpadliya | 0 | 52,506,007,806 | 75% | ||
oldman28 | 0 | 18,792,079,846 | 60% | ||
kangnajiang | 0 | 200,935,366 | 100% | ||
kikima | 0 | 763,592,567 | 100% | ||
geass | 0 | 638,734,236 | 100% | ||
floatinglin | 0 | 4,478,507,671 | 100% | ||
accelerator | 0 | 6,170,167,878 | 1.2% | ||
superbing | 0 | 4,246,859,238 | 100% | ||
dailyfortune | 0 | 3,556,140,748 | 100% | ||
dobartim | 0 | 486,644,603,834 | 36% | ||
xiaoshancun | 0 | 19,002,539,693 | 100% | ||
stef1 | 0 | 558,901,968,457 | 100% | ||
dailystats | 0 | 5,666,094,169 | 100% | ||
khaleelkazi | 0 | 396,303,022 | 1.2% | ||
jianan | 0 | 6,905,572,587 | 100% | ||
emrebeyler | 0 | 0 | 1.2% | ||
daxiang | 0 | 224,341,953 | 100% | ||
anxin | 0 | 2,733,642,723 | 100% | ||
nokodemion | 0 | 46,879,373,032 | 100% | ||
steembasicincome | 0 | 52,856,172,088 | 4.85% | ||
joslud | 0 | 3,051,497,578 | 100% | ||
mmmmkkkk311 | 0 | 775,067,273,298 | 100% | ||
flysky | 0 | 180,416,092,555 | 15% | ||
moobear | 0 | 201,771,126 | 100% | ||
nealmcspadden | 0 | 4,278,703,138 | 1.2% | ||
mermaidvampire | 0 | 26,862,947,045 | 100% | ||
durbisrodriguez | 0 | 881,705,609 | 100% | ||
nean | 0 | 490,510,114 | 100% | ||
foodielifestyle | 0 | 487,516,558 | 100% | ||
woolfe19861008 | 0 | 2,383,291,972 | 100% | ||
dailychina | 0 | 6,663,411,978 | 100% | ||
vincenthan | 0 | 528,854,690 | 100% | ||
yuxuan | 0 | 244,191,118 | 100% | ||
dongfengman | 0 | 12,284,046,286 | 100% | ||
serenazz | 0 | 1,215,629,319 | 100% | ||
yedda | 0 | 482,730,758 | 100% | ||
zasilla | 0 | 492,215,706 | 100% | ||
aaronstar | 0 | 10,635,793 | 100% | ||
ethanlee | 0 | 5,071,104,212 | 100% | ||
twinsnicole | 0 | 498,002,422 | 100% | ||
deepthinking | 0 | 510,993,560 | 100% | ||
gogoabc | 0 | 19,758,338 | 100% | ||
fabpoleo24 | 0 | 640,274,388 | 100% | ||
zainnyferdhoy | 0 | 866,108,715 | 100% | ||
carlos2115 | 0 | 479,565,050 | 100% | ||
fanso | 0 | 1,542,759,585 | 100% | ||
yameen | 0 | 4,026,678,390 | 20% | ||
atego | 0 | 43,919,588,496 | 50% | ||
lilypang22 | 0 | 1,423,601,705 | 100% | ||
fishcc | 0 | 0 | 100% | ||
fishdd | 0 | 0 | 100% | ||
yuting | 0 | 80,910,760 | 100% | ||
lilyan | 0 | 122,434,588 | 100% | ||
zens | 0 | 506,198,677 | 100% | ||
steemitvip | 0 | 510,146,213 | 100% | ||
regals | 0 | 492,687,184 | 100% | ||
baymaxos | 0 | 0 | 100% | ||
joelone | 0 | 487,107,951 | 100% | ||
sweet-jenny8 | 0 | 23,533,796,024 | 100% | ||
atinna | 0 | 0 | 100% | ||
myskye | 0 | 14,820,829,097 | 100% | ||
alpdurm | 0 | 184,585,956 | 50% | ||
digital.mine | 0 | 71,619,051,044 | 1.5% | ||
chineselaw | 0 | 2,949,986,759 | 100% | ||
ffbank | 0 | 125,974,050 | 100% | ||
weicomenew | 0 | 508,490,721 | 100% | ||
laiyuehta | 0 | 4,888,668,727 | 100% | ||
turtlegraphics | 0 | 2,641,061,298 | 100% | ||
glory7 | 0 | 7,361,870,113 | 2.5% | ||
jayplayco | 0 | 8,809,624,818 | 5% | ||
dlike | 0 | 50,321,015,279 | 3.9% | ||
selce-n | 0 | 3,803,897,920 | 100% | ||
witnesstools | 0 | 7,486,656,984 | 100% | ||
ilovecoding | 0 | 7,000,347,960 | 100% | ||
new-steemit | 0 | 6,438,762,422 | 12% | ||
steemfuckeos | 0 | 3,425,397,757 | 100% | ||
edgarare1 | 0 | 363,538,824,382 | 100% | ||
kakakk | 0 | 228,985,494 | 3% | ||
skymin | 0 | 31,812,178,589 | 50% | ||
dknkyz | 0 | 2,436,468,718 | 20% | ||
janyasai | 0 | 1,849,249,207 | 10% | ||
ninjacyber | 0 | 1,962,356,922 | 20% | ||
rankmeupclub | 0 | 2,714,330,009 | 30% | ||
fi2eedom | 0 | 2,562,267,260 | 30% | ||
rmu01 | 0 | 2,818,527,042 | 30% | ||
rull14958 | 0 | 869,714,428 | 40% | ||
plankton.token | 0 | 45,857,002,041 | 75% | ||
quantumdeveloper | 0 | 4,943,359,516 | 100% | ||
blockcleaner | 0 | 24,350,618,229 | 100% | ||
steem.leo | 0 | 1,374,126,285 | 1.2% | ||
cplusplus | 0 | 7,027,558,149 | 100% | ||
leo.voter | 0 | 37,673,017 | 1.2% | ||
justsoso | 0 | 1,783,030,449 | 100% | ||
soonhai | 0 | 1,923,661,784 | 9% | ||
perrymine | 0 | 6,467,420,977 | 12% | ||
hykwf233 | 0 | 803,646,028 | 100% | ||
maxuvd | 0 | 6,755,741,710 | 11% | ||
icetea | 0 | 1,619,438,124 | 40% | ||
longhash | 0 | 1,593,272,495 | 100% | ||
cnlifes | 0 | 0 | 100% | ||
cnfish | 0 | 2,518,983 | 100% | ||
llfestyle | 0 | 404,553,503 | 100% | ||
photosnap | 0 | 1,255,182,593 | 20% | ||
steeemmonsters | 0 | 0 | 100% | ||
maiydue | 0 | 15,437,905 | 100% | ||
deepcrypti8 | 0 | 19,301,810 | 100% | ||
morningshlne | 0 | 0 | 100% | ||
leodec | 0 | 0 | 100% | ||
sexybeach | 0 | 7,043,161,018 | 100% | ||
suckmydick | 0 | 3,395,629,561 | 100% | ||
chromebook | 0 | 3,428,291,370 | 100% | ||
successgr | 0 | 376,191,490,155 | 3% | ||
ericandryan | 0 | 10,309,046,652 | 100% | ||
kjinhyun | 0 | 46,406,656,336 | 50% | ||
dev.supporters | 0 | 149,311,548,094 | 10% | ||
rmu.proxy | 0 | 1,985,107,580 | 30% | ||
tina1219 | 0 | 447,157,553 | 100% | ||
steemgoon | 0 | 3,030,585,678 | 35% | ||
goonz | 0 | 1,800,407,390 | 50% | ||
sometacos | 0 | 3,332,464,698 | 40% | ||
beargame | 0 | 32,360,538,650 | 5% | ||
naturebeauty | 0 | 355,467,357 | 40% | ||
justyy222 | 0 | 3,414,243,240 | 100% | ||
dalyaok | 0 | 855,374,165 | 30% | ||
vwatata | 0 | 903,920,588 | 100% | ||
legendaryfairy | 0 | 1,172,186,922 | 30% | ||
juddsmith079 | 0 | 28,620,320,352 | 5% | ||
roundblocknew | 0 | 19,288,232,208 | 5% | ||
mildaleblanc | 0 | 193,004,909,113 | 5% | ||
denzelwash | 0 | 1,226,663,344 | 100% | ||
rishihrutu | 0 | 111,549,129,170 | 100% | ||
pharos1999 | 0 | 312,143,186,258 | 5% | ||
pluepark | 0 | 3,031,926,863 | 5% |