432. All O`one Data Structure | doubly linked list | hashing | Leetcode Daily Challenge | DSA | Java
shashCode shashCode
20.1K subscribers
1,930 views
151

 Published On Sep 29, 2024

Problem Name:
432. All O`one Data Structure

Problem Statement:
Design a data structure to store the strings' count with the ability to return the strings with minimum and maximum counts.

Implement the AllOne class:

AllOne() Initializes the object of the data structure.
inc(String key) Increments the count of the string key by 1. If key does not exist in the data structure, insert it with count 1.
dec(String key) Decrements the count of the string key by 1. If the count of key is 0 after the decrement, remove it from the data structure. It is guaranteed that key exists in the data structure before the decrement.
getMaxKey() Returns one of the keys with the maximal count. If no element exists, return an empty string "".
getMinKey() Returns one of the keys with the minimum count. If no element exists, return an empty string "".
Note that each function must run in O(1) average time complexity.

Problem Link:
https://leetcode.com/problems/all-oon...

Solution Link:
https://github.com/Tiwarishashwat/Int...

Graph Playlist:
   • Graph Data Structure Series  

Java Plus DSA Placement Course Playlist:
   • Java and DSA Course Playlist : Online...  

Java Plus DSA Sheet:
https://docs.google.com/spreadsheets/...

Notes:
https://github.com/Tiwarishashwat/Jav...

Telegram Link:
https://shashwattiwari.page.link/tele...

Ultimate Recursion Series Playlist:
   • Recursion and Backtracking Ultimate S...  

Instagram Handle: (@shashwat_tiwari_st)
https://shashwattiwari.page.link/shas...

Samsung Interview Experience:
   • I cracked Samsung | SRIB Interview Ex...  

Company Tags:
Facebook | Amazon | Microsoft | Netflix | Google | LinkedIn | Pega Systems | VMware | Adobe | Samsung

Timestamp:
0:00 - Introduction

#ShashwatTiwari #coding​​ #problemsolving​

show more

Share/Embed