Leetcode with dani
1.29K subscribers
202 photos
14 videos
56 files
243 links
Join us and let's tackle leet code questions together: improve your problem-solving skills
Preparing for coding interviews
learning new algorithms and data structures
connect with other coding enthusiasts
Download Telegram
Day 5
πŸ—“ Daily Challenge #1
🧩 Build Array from Permutation
Given an array nums, build a new array ans where ans[i] = nums[nums[i]] for every index i.
Can you solve it without extra space? (Hint: Think modulo!)

πŸ”— Problem Link:
πŸ“Œ Difficulty: Easy
🏷 Tags: #Array #InPlace

πŸ’‘ Let’s see your optimized solutions!
πŸ‘‰ Drop your approach in the comments!

πŸ“Š Problem Breakdown #2
πŸ”„ Matrix Rotation Check
Given two n x n matrices, determine if one can be obtained by rotating the other 90Β°, 180Β°, or 270Β°.
How would you efficiently check all possible rotations?

πŸ”— Problem Link:
πŸ“Œ Difficulty: Medium
🏷 Tags: #Matrix #Transpose

πŸ€” Think about transpose + reverse vs. brute force. Which is better?
πŸ‘‰ Share your code snippets!

πŸš€ Advanced Problem Alert!
πŸ”’ Tuple with Same Product
Find the number of tuples (a, b, c, d) such that a*b = c*d where all elements are distinct.
Can you avoid an O(n⁴) solution? (Hint: Hash maps are your friend!)

πŸ”— Problem Link:
πŸ“Œ Difficulty: Medium
🏷 Tags: #HashTable #Combinatorics

πŸ’₯ Challenge: Optimize for large arrays!
πŸ‘‰ Post your best time complexity in the comments!
πŸ‘3