DEV Community

vishal.codes
vishal.codes

Posted on

Day 32/366

๐Ÿš€ Today's Learning:
๐ŸŒŸ DSA

  • Check whether two Strings are anagram of each other
  • Print all anagrams together

๐ŸŒŸ Dev

  • Redux Persist

๐Ÿ” Some Key Highlights:

DSA

To check whether two strings are anagrams of each other, iterate through each character of both strings, counting the frequency of each character in each string using a hashmap. Then, compare the frequency maps of both strings. If the maps are identical, the strings are anagrams; otherwise, they are not.

To print all anagrams together, create a hashmap where the keys are sorted versions of each word in the input list, and the values are lists of words that are anagrams of each other. Iterate through the input list of words, sorting each word and using the sorted word as a key to group anagrams together in the hashmap. Finally, iterate through the hashmap and print each list of anagrams together.

DEV

Redux Persist is a library used in Redux-based applications to persist the Redux state to storage, typically AsyncStorage in React Native or localStorage in web applications. It allows the state to be saved across browser or app restarts, ensuring a seamless user experience. Redux Persist works by integrating with the Redux store and providing middleware that automatically saves the state to storage whenever it changes. Upon app or browser restart, the persisted state is retrieved from storage and rehydrated into the Redux store, allowing the application to resume from where it left off. This library simplifies the process of implementing persistence in Redux applications, enhancing reliability and user satisfaction.

#100daysofcode #1percentplusplus #coding #dsa

Top comments (0)