See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| class Solution { | |
| // This approach is O(n), where n = length of string s | |
| // The sliding window approach uses two pointers to traverse a string in linear time. Each character is visited | |
| // at most twice | |
| // There's a method `mapHasAllChars` whose time complexity may not be intuitive, so it's worth mentioning. At most | |
| // each map will contain all the characters from the ascii set (0 - 255), so we know that at most we will always visit 256 | |
| // keys every time we call this method. So note this => | |
| // AS LONG AS WE KNOW THE WORST CASE FOR NUMBER OF LOOP ITERATIONS BEFOREHAND, THAT LOOP'S TIME COMPLEXITY IS CONSTANT | |
| public String minWindow(String s, String t) { | |
| //Edge Cases |
| const start_time = performance.now(); | |
| const count: number = 1000; | |
| const wallets: Wallet[] = []; | |
| const walletCount = await WalletModel.find({}).estimatedDocumentCount(); | |
| // create a cursor for every `currentIndex` documents in the collection | |
| const getNthCursor = async (currentIndex: number) => | |
| await WalletModel.find({ deleted_at: undefined }, { timeout: false }) | |
| .lean() |