leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

Add optimized solution with O(n) - javascript/0347-top-k-frequent-elements.js

Open tayyabferozi opened this issue 2 years ago • 1 comments

The changes include a new solution that does the job in O(n) as described in the video without sorting the frequency array taking O(logN)

  • File(s) Modified: javascript/0347-top-k-frequent-elements.js
  • Language(s) Used: javascript
  • Submission URL: https://leetcode.com/problems/top-k-frequent-elements/submissions/940823835/

Important

Please make sure the file name is lowercase and a duplicate file does not already exist before merging.

tayyabferozi avatar Apr 27 '23 22:04 tayyabferozi

Another solution was added

The changes include a new solution that does the job using hashmaps as described in the video.

File(s) Modified: javascript/0424-longest-repeating-character-replacement.js Language(s) Used: javascript Submission URL: https://leetcode.com/problems/longest-repeating-character-replacement/submissions/941797943/

Important Please make sure the file name is lowercase and a duplicate file does not already exist before merging.

tayyabferozi avatar Apr 29 '23 22:04 tayyabferozi