DEV Community

Somuya Khandelwal
Somuya Khandelwal

Posted on • Edited on

DAY 55 Wrapping Up with Hash Maps and Sets

Hello Everyone!

The last day of Week 11 was dedicated to such part as Hash Map/Set Problems which united topics of relations between data and symmetry. The following tasks made me consider examples of how to manage and analyze data using hashing as part of of part of the solution. I felt that I was trying to sort and arrange tangled jungles of patterns for better order and symmetry.


Pep Hunt: How the Day Played Out

  1. If two strings are similar (recommended as a medium level)

    Decide if there are a couple of strings whose characters differ in frequency and can be transformed into one another through the swapping of similar characters.

    • The Strategy: Counted/create hash maps of characters for strings for character count frequencies. Ensured that both strings contained the same unique characters and the frequency set.
    • The Fun Part: Comparing the frequencies of the characters was rather like solving a cipher.
  2. **Equal Row and Column Pairs There are four pair of rows and columns with equal letters and numbers in medium difficulty Sudoku table.

    – sum of values where two rows and two columns match.

    • The Strategy: For , frequency of rows were required as tuples so a hash map was used. To look for a matching pair of elements, for each column formed a tuple and checked whether this particular tuple exists in the hash map.
    • The Fun Part: Analyzing symmetry between rows and columns gave me the impression of a detective tracing enigma in a matrix.

Special things About today

  1. Symmetry in Data: Both problems underlined the search for and utilization of balance – in strings or grids – to decipher complicated relationships.
  2. Hash Map Efficiency:

    Activities like Equal Row and Column Pairs revealed how hash maps enhance sorts and storage hence minimizing computational expenses.

  3. Real-World Relevance:

    These problems resembled real-life types of analysis, for example, comparing two or more sets of data or investigation of interactions in the structural data.


Key Takeaways

  • Hash Maps Simplify Relationships:

    The control of character frequencies to the rank and control of row and column mappings show how hash maps are applicable to relational data.

  • Symmetry Reduces Complexity:

    Finally, Equal Row and Column Pairs employed in the model bring additional value into recognition and usage of symmetrical patterns into calculations that in turn decrease rates of redundant computations.

  • Pattern Recognition is Key:

    In both tasks, a focus was made on pattern recognition and dissection of issues into sub-components.


Reflections

The Determine if Two Strings Are Close problem was rather fun to think about in terms of comparing relations between character frequencies, and Equal Row and Column Pairs showed how even arrays could be beautiful if they are symmetric. Combined, these partials concluded Week 11 with a reasonable combination of logical analysis, optimization and regularity.


What’s Next?

Thus, with Week 11 coming to an end, it’s time to move to Week 12’s schedule, which is Dynamic Programming, Graph Problems, and Backtracking Challenges. As the upcoming week has in store more challenges and higher level thinking assignments, the solution to the problems is expected to continue.

I would like to thank you for following me! Let’s continue to do our best in solving, learning and growing as a team

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay