Gzip Compress Text
NodeJS
Hard
4 views
Problem Description
Compress a string with gzip and print compressed byte length.
Output Format
Print integer bytes.
Constraints
Use zlib.gzipSync.
Official Solution
const zlib = require('zlib');
const input = Buffer.from('meetcode meetcode meetcode', 'utf8');
const gz = zlib.gzipSync(input);
console.log(gz.length);
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!