Leetcode Biweekly Contest 37

in #codeonsteemlast month

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-37

Today's contest difficulty - considered to be medium/high. I have solved 2 out of 4 - the third one WA and the last one Time Limited Exceeded.


The programming language I choose is C++. I have quite many wrong answers or Time Limit Exceeded - which adds a lot of time penalization to the final result.

Mean of Array After Removing Some Elements

Easy. Just compute the sum without the min and max 5.

Coordinate With Maximum Network Quality

Medium: O(N^2) to compute the sum of quality factors and choose the best.

Number of Sets of K Non-Overlapping Line Segments

Medium: Dynamic Programming

Fancy Sequence

Difficulty - Hard: You need to compress the formula to x*a + b so that it is O(1) constant.

Follow me for topics of Algorithms, Blockchain and Cloud.
I am @justyy - a Steem Witness

Steem On!~
Every little helps! I hope this helps!

If you like my work, please consider voting for me or Buy Me a Coffee, thanks!
https://steemit.com/~witnesses type in justyy and click VOTE

Alternatively, you could proxy to me if you are too lazy to vote!

Also: you can vote me at the tool I made: https://steemyy.com/witness-voting/?witness=justyy

Coin Marketplace

STEEM 0.17
TRX 0.03
JST 0.024
BTC 18367.78
ETH 608.60
SBD 1.21