codedecks-in / LeetCode-Solutions

This repository consists of solutions to the problem from LeetCode platform. Subscribe to our Channel for more updates
https://www.youtube.com/c/codedecks
MIT License
821 stars 415 forks source link

Work branch #449

Open navneet-raj-karn opened 11 months ago

navneet-raj-karn commented 11 months ago

Description

Intuition Counting bits

Approach No matter how many times operations are taken, the total bit number for the specific position is unchanged. The k biggest integers can be made from those bits collected from all numbers.

Complexity Time complexity: O(31×n+31×k)=O(n+k)O(31×n+31×k)=O(n+k)O(31×n+31×k)=O(n+k)

Space complexity: O(n)

welcome[bot] commented 11 months ago

I can tell this is your first pull request! Thank you I'm so honored. :tada::tada::tada: I'll take a look at it ASAP!