← Back to Dashboard

Data Structures: Hard Exercises HARD

"""
Topic 05: Data Structures - HARD Exercises (10)
"""

# Exercise 1: Matrix Transpose - Given a 3x3 matrix as a list of lists, calculate its transpose using list comprehension.
# matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
# Write your code below:


# Exercise 2: Implementing a frequency counter of characters in a string without using built-in Counter.
# Return a dictionary sorted by the characters with the highest frequency.
# Write your code below:


# Exercise 3: Nested Dictionary Navigation - Given a deep dictionary (employees -> department -> name -> salary),
# write a function that takes a name and returns their salary.
# Write your code below:


# Exercise 4: Set Problem - Find the common elements between three sets without using intersection().
# Write your code below:


# Exercise 5: Create a program that simulates a basic "Shopping Cart". 
# The cart should be a list of dictionaries, each having title, price, and quantity.
# Calculate the total bill, applying a 5% tax at the end.
# Write your code below:


# Exercise 6: List Manipulation - Write a function to check if a list is a subset of another list.
# Write your code below:


# Exercise 7: Use zip() to combine two lists into a dictionary.
# keys = ["Name", "Age", "Role"], values = ["Alice", 30, "Developer"]
# Write your code below:


# Exercise 8: Set difference - Given two lists, return a new list containing elements that are 
# only in the first list but not the second, using sets.
# Write your code below:


# Exercise 9: Implement a "Sparse Matrix" using a dictionary. 
# Store only non-zero elements with their (row, col) as keys.
# Write your code below:


# Exercise 10: Logic Challenge - Find the first non-repeating character in a string using a dictionary.
# Write your code below: