Day17 #Leetcode#100dayschallenge#100DaysOfCoding#365days
Q:Maximum Swap
You are given an integer num. You can swap two digits at most once to get the maximum valued number.
Return the maximum valued number you can get.
Today's LeetCode question is toooooo easy! π
Everyone should try it! π
π Sep 28
π Day 59/100
βοΈ #LeetCode Q1614 β Maximum Nesting Depth of the Parentheses
π Sep -24
Today's LeetCode question is very easy! π
Everyone should give it a try. π
π Day 55/100
βοΈ #LeetCode Q3550. Smallest Index With Digit Sum Equal to Index
Keep solving, keep learning, and stay consistent!
π Sep-23
ππ Days -54/100
βοΈ #LeetCode Q1321. Restaurant Growth
πNOTE:
Self-join with a range condition: d2.visited_on BETWEEN d1.visited_on - INTERVAL '6 days' AND d1.visited_on β for each "anchor" date d1, this pulls in every d2 row whose date falls within the 7-day
π Sep -22
π Day 53/100
βοΈ #LeetCode Q176. Second Highest Salary
πNOTE:
DENSE_RANK() OVER (ORDER BY salary DESC) β assigns rank 1 to the highest salary(s), rank 2 to the next distinct salary value
π Sep-21
π Day 52/100
βοΈ #LeetCode Q626. Exchange Seats
πNOTE:
Even idβid-1: swaps each even-numbered seat's id down by one, pairing it with odd seat before it.
Odd id,and not the last seatβid+1: swaps each odd seat's id up by one, pairing it with even seat after it.
π Sep -20
π Day 51/100
βοΈ #LeetCode Q3220. Odd and Even Transactions
πNOTE:
SUM(CASE WHEN amount % 2 <> 0 THEN amount ELSE 0 END) β sums only the odd
SUM(CASE WHEN amount % 2 = 0 THEN amount ELSE 0 END) β sums only the even amounts.
Too Easyπ
πTodayβs LeetCode question was super easy.
Everyone should give it a tryπ»
However,in this solution, I created a hardcoded dictionary for the alphabet instead of using Pythonβs built-in ord() function
Just trying a different approach to understand the logic better
π Sep-19
π Day 50/100
βοΈ 1401. Circle and Rectangle Overlapping
πNOTE: Todayβs LeetCode DSA Question
min(xCenter, x2) caps xCenter so it never exceeds the rectangle's right edge.
π Sep -18
π Day 49/100
πNOTE:
Keyword =SQL's predefined word
Identifier =your database object's name
PostgreSQL normally allows a maximum of 63 bytes for an identifier.
PostgreSQL doesn't care about the capitalisation of unquoted keywords and identifiers.
βοΈ #LeetCode
Shopkeeper: Total amount is 16000
Customer: Sure, doing UPI
Shopkeeper: If you do, UPI, pay Rs 64 extra
Customer: Why? This is wrong
Shopkeeper: Government is charging that money. Not me
Customer: I will do Cash payment then
Government is killing UPI now, cash will be back.