Leetcode Biweekly Contest 30 by justyy

View this thread on steempeak.com
· @justyy ·
$33.90
Leetcode Biweekly Contest 30
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-30

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 Python, C++. I have 1 Wrong Answer submission for Problem 3 - which adds total 10 minutes time penalization.


![image.png](https://cdn.steemitimages.com/DQmUaFWtkAwunRKTUt7pozLHUrXccxkF7xJJSVXHAjhZAS6/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.

## Reformat Date
https://leetcode.com/contest/biweekly-contest-30/problems/reformat-date/
It is harder to use C++ as in C++ the [string split function](https://helloacm.com/how-to-split-a-string-in-c/) is not native. Python is good.

## Range Sum of Sorted Subarray Sums
https://leetcode.com/contest/biweekly-contest-30/problems/range-sum-of-sorted-subarray-sums/
O(N^2) will work - as the input range is (10^3), however beware of the integer overflow.

## Minimum Difference Between Largest and Smallest Value in Three Moves
https://leetcode.com/contest/biweekly-contest-30/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves/
Sorting (O(N^LogN)) and then compare four different possibilities.

## Stone Game IV
https://leetcode.com/contest/biweekly-contest-30/problems/stone-game-iv/
Dynamic Programming, similar to [this puzzle](https://helloacm.com/dynamic-programming-perfect-squares/)

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)
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 53 others
properties (23)
post_id86,662,067
authorjustyy
permlinkleetcode-biweekly-contest-30
categorywitness-category
json_metadata{"tags":["witness-category","programming","whalepower","algorithms","coding","leetcode","contest","codeonsteem"],"image":["https:\/\/cdn.steemitimages.com\/DQmUaFWtkAwunRKTUt7pozLHUrXccxkF7xJJSVXHAjhZAS6\/image.png","https:\/\/steemyy.com\/images\/vote-for-justyy.jpg"],"links":["https:\/\/leetcode.com\/contest\/biweekly-contest-30","https:\/\/leetcode.com\/contest\/biweekly-contest-30\/problems\/reformat-date\/","https:\/\/helloacm.com\/how-to-split-a-string-in-c\/","https:\/\/leetcode.com\/contest\/biweekly-contest-30\/problems\/range-sum-of-sorted-subarray-sums\/","https:\/\/leetcode.com\/contest\/biweekly-contest-30\/problems\/minimum-difference-between-largest-and-smallest-value-in-three-moves\/","https:\/\/leetcode.com\/contest\/biweekly-contest-30\/problems\/stone-game-iv\/","https:\/\/helloacm.com\/dynamic-programming-perfect-squares\/","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"}
created2020-07-11 16:23:30
last_update2020-07-11 16:23:30
depth0
children2
net_rshares51,029,877,479,688
last_payout2020-07-18 16:23:30
cashout_time1969-12-31 23:59:59
total_payout_value17.832 SBD
curator_payout_value16.072 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length2,473
author_reputation2,062,739,781,884,297
root_title"Leetcode Biweekly Contest 30"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (117)
@annepink ·
$0.08
properties (23)
post_id86,666,984
authorannepink
permlinkqdc8fg
categorywitness-category
json_metadata{"app":"steemcn\/0.1"}
created2020-07-12 03:59:45
last_update2020-07-12 03:59:45
depth1
children1
net_rshares216,254,085,383
last_payout2020-07-19 03:59:45
cashout_time1969-12-31 23:59:59
total_payout_value0.040 SBD
curator_payout_value0.041 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length8
author_reputation160,119,580,804,298
root_title"Leetcode Biweekly Contest 30"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (70)
@justyy ·
ζ„Ÿθ°’οΌŒε›žθ΅žγ€‚
πŸ‘  
properties (23)
post_id86,670,282
authorjustyy
permlinkqdcqav
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-12 10:25:45
last_update2020-07-12 10:25:45
depth2
children0
net_rshares294,525,034
last_payout2020-07-19 10:25:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length6
author_reputation2,062,739,781,884,297
root_title"Leetcode Biweekly Contest 30"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)