Leetcode Biweekly Contest 37

in programming •  4 years ago 

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.

image.png

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

https://leetcode.com/contest/biweekly-contest-37/problems/mean-of-array-after-removing-some-elements
Easy. Just compute the sum without the min and max 5.

Coordinate With Maximum Network Quality

https://leetcode.com/contest/biweekly-contest-37/problems/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

https://leetcode.com/contest/biweekly-contest-37/problems/number-of-sets-of-k-non-overlapping-line-segments
Medium: Dynamic Programming

Fancy Sequence

https://leetcode.com/contest/biweekly-contest-37/problems/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
https://steemyy.com

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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!