Leetcode Biweekly Contest 31

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

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 in more details soon.

Although the contest has ended, you can try to participate on the virtual contest.


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



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

Visit me at: https://steemyy.com


This page is synchronized from the post: ‘Leetcode Biweekly Contest 31’

Remove the Temporary Files (including Windows.old) on Windows 10 to Save Space via Storage Sense

Recently I found out on my C:\ there is a folder windows.old probably this is due to the fact that I refreshed my Windows 10 using a Recovery software from Microsoft.

Can I safely delete Windows.old Folder?


Yes, The windows.old contains the previous Windows installation files, and is scheduled to be deleted after 30 days by OS. Prior to then, those files are protected and can’t be deleted unless you use the Storage sense.

Go to Settings and Navigate to Storage

Select the Temporary Files, you will see Previous Windows Installation, Tick it and Click Remove.

By default, the Temporary Files will be kept 30 days before they are automatically removed. You can configure the

You can also configure to let it clean the files every day, week or month. This should free up your harddisk space.


Every little helps! I hope this helps!

Steem On!~

Reposted to Computing and Technology

If you like my work, please consider voting for me, 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

Visit me at: https://steemyy.com


This page is synchronized from the post: ‘Remove the Temporary Files (including Windows.old) on Windows 10 to Save Space via Storage Sense’

The importance of Backup

I recently lost a harddrive. I sent it to data recovery, and paid for 300 GBP, however, no data was recovered.

Unfortunately we could not recover the data from the hard drive due to media damage on the hard drive disk platters.

We imaged your hard drive disk platters 6%, however there was 94% we could not image from your disk platters.

We scanned the 6% image for any good data, unfortunately no good data was recovered from the partial image.

Initial problem on the hard disk was read/write head failure, although this did not cause any media damage to start with, it seems the hard drive was powered on for a period of time after the read/write head failure which caused media damage on the disk platters.

Your only other option for recovery is a forensic style recovery in our lab in London.

We don’t feel this is a viable option based on the low percentage your disk platters were imaged but if you need them to review your job let us know and I will put in a request to them (it takes them one day to review jobs, forensic cost for your size of drive would be around the £1000+vat mark).

I lost years of Family data and photos. One lucky thing is that I posted occasionally on social networks (including steem) some photos.

Two lessons learnt:

  1. I should have backups, ideally more than one, on different harddrive. I should ‘ve also stored photos/videos on Cloud apart from important files and data. Google Photos are free/unlimited if you choose a compressed format to store all the photos/data

  2. Once the harddrive becomes faulty, don’t try to play your lucks by plugging in. The broken headers may actually damage the disk platters which causes further data recovery to fail. Once it is faulty, unplug, and sent it to data professionals for data recovery.

  3. Use a software to monitor the health of harddrive regular. Once it is about to fail, replace them.

  4. Use RAID.


Every little helps! I hope this helps!

Steem On!~

Computing and Technology

If you like my work, please consider voting for me, 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

Visit me at: https://steemyy.com


This page is synchronized from the post: ‘The importance of Backup’

Performance Comparison between Two RPC Nodes

I have compared the RPC node performance between api.justyy.com (Germany) and api.steemyy.com (Japan) for visitors coming from China

image.png

As we can see, the German RPC node are quite slow (orange) and the Japanese RPC node is a bit faster (green) for most parts of China, especially the eastern coast.

Compared to api.steemit.com the official node, these two nodes provide a good alternative.


Every little helps! I hope this helps!

Steem On!~

Computing and Technology

If you like my work, please consider voting for me, 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

Visit me at: https://steemyy.com


This page is synchronized from the post: ‘Performance Comparison between Two RPC Nodes’

Tesco & Hired Programming Competition Aborted due to Technical Issues

Today, at BST 5:00PM, the first programming contest (virtual) is scheduled. This event is sponsored by Tesco and organised by Hired.

image.png

There were around 180+ participants on the zoom meeting. But unfortunately, the hired website kinda got DDos when ‘so many’ concurrent users are trying to log in.

image.png

After 10 minutes, the organised annouced that the event unfortunately has to be aborted. Good thing to know is that it is not totally cancelled. It will be changed to offline coding contest: given 2 coding tasks, finish within 24 hours instead of 1 hour online. Code will be graded and the winner will be getting 1000 TESCO gift card!

Good luck and have fun!


Every little helps! I hope this helps!

Steem On!~

Computing and Technology

If you like my work, please consider voting for me, 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

Visit me at: https://steemyy.com


This page is synchronized from the post: ‘Tesco & Hired Programming Competition Aborted due to Technical Issues’

Testing the Speed for the Load Balancing Node of STEEM - Part 1 - China

In this post, I am going to test the page speed to the Load Balancer RPC Node for STEEM: https://steem.justyy.workers.dev The tool is done via the http://ping.chinaz.com/steem.justyy.workers.dev

image.png

image.png

A few comments:

  1. most of China can’t access api.steemit.com
  2. the ping of the Load Balancing Node steem.justyy.workers.dev is still quite high in China.
  3. In order to speed up access in China, one needs to apply ICP, which is the short name for “Internet Content Provider”.

According to Chinese regulation, all website hosted in Mainland China or content served from Chinese data centers (which is true for our China Network service) needs to obtain an ICP “BeiAn备案” or “License 证” number for every domain that serves content to your pages. These number needs to be displayed on footer of your pages.

With ICP, then we can use the CDN to speed up the access in China.


Every little helps! I hope this helps!

Steem On!~

Computing and Technology

If you like my work, please consider voting for me, 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

Visit me at: https://steemyy.com


This page is synchronized from the post: ‘Testing the Speed for the Load Balancing Node of STEEM - Part 1 - China’

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×