#Day1 of 30 days POTD challenge with @whyrohitwhy & @dominateXclub
Q. Largest Positive Integer That Exists With Its Negative
used 2 pointer approach to solve this!
#Day2 of 30 days POTD challenge 🏆🏆
What is your approach?
✅ Easy • Strings • 2 Pointers
After sorting used 2 pointers and compared till found any results, otherwise return -1.
For tomorrow we will se medium questions , @vaishnavi0199 be prepared!🙌🤩
#Leetcode#DSA #DominateTwitter
Hi! I'm looking to #Connect with people who are hiring in
🌐 Web Development
🎨 FrontEnd
⚙️Coding
🔧 DevOps
🚀UI/UX
📂 Al/ML
💻Software Development
💼 Freelancing
#letsconnect#buildinpublic#Connect
📌Explanation:
1. Check if combination of all side forms valid triangle
2. Calculate sum of each pair of sides & compare it with 3rd side
3. If all 3 comparisons true then label= 'Yes', else 'No'
4. Apply this check to all records
5. Add new column 'triangle' containing step 2,3
✅Day 32 of #SQL Series
LC Easy to Difficult SQL question & solution explained:
Q. Report for every three line segments whether they can form a triangle. Return the result table in any order.
Thread🧵
#100daysofcodechallenge#50daysofSQL
@LeetCode@SQLServer@MySQL 📌Explanation:
1. From employee select unique combinations of emp IDs & dept ID
2. Write subquery to
i. add filter that includes only employees who either have single count OR their primary_flag is 'Y'
3. Group by employee ID to get all employees with their primary department
✅Day 31 of #SQL Series
Write a solution to report all employees w their primary dept. For employees who belong to 1 department, report their only department.
Note->when employee belongs to only one department primary column is 'N'
Thread🧵
#100daysofcodechallenge#50daysofSQL
@LeetCode@SQLServer@MySQL 📌Explanation:
1. Inner join Employee table with itself to pair employee with their report
2. Count no. of direct reports for each employee
3. Get avg age of direct reports for each employee
4. Group by employee ID & name
5. Arrange employee_ID as ASC
#100daysofcodechallenge
✅Day 30 of #SQL Series
Q. Write solution to report id & names of all managers, number of employees who report directly to them, & the average age of reports rounded to nearest integer.
Return table by employee_id.
manager-who has min 1 other employee reporting to them
Thread🧵
@SQLServer@MySQL@Aakriti_Sarma@PostgreSQL@LeetCode 📌Explanation:
1. From customer table Group by customers using their ID.
2. Count how many unique products each customer bought.
3. Check if this count matches the total number of products available.
4. Select customer IDs who bought every product.
✅Day 29 of #SQL Series
LC Easy to Difficult SQL question & solution explained:
Q. Write a solution to report customer ids from Customer table that bought all products in Product table. Return the result table in any order.
Thread🧵
#100daysofcodechallenge#30daysofSQL