TL;DR: Replace s_0
with s_1
, s_1
with s_2
and so on (assuming the largest number to
replace is less than 26):
s/s_\(\d\+\)/\='s_'.(nr2char(97+submatch(1)))/g
Striving for efficient, effective and easy to use systems that achieve complex goals. I engineer software that meets real needs; solving problems and helping others. Outside of my professional work, I may also be found doing interesting things for no reason other than fun or intellectual curiosity.
Take a look at:
TL;DR: Replace s_0
with s_1
, s_1
with s_2
and so on (assuming the largest number to
replace is less than 26):
s/s_\(\d\+\)/\='s_'.(nr2char(97+submatch(1)))/g
Reservoir Sampling refers to a family of algorithms for sampling a fixed number of elements from an input of unknown length with uniform probabilities. In this article, I aim to give an overview of Reservoir Sampling usage, implementation and testing. When/why is Reservoir Sampling useful? The main benefit of Reservoir Sampling is that it provides an upper bound on memory usage that is invariant of the input stream length. This allows sampling input streams which are far larger in size than the available memory of a system.
A solution and, importantly, a proof for LeetCode Problem 11 - Container with Most Water.