Leetcode #2419. longest subarray with maximum bitwise AND
Given an array of size n, we have to find non empty subarray from nums that has maximum possible bitwise AND
[1,2,3,3,2,2] has max possible bitwise AND of a subarray is 3, longest subarray is [3,3].
Contdβ¦
1642. Daily Problem
On the rarest days when DP fails to solve a problem, here is why greedy can be better for this question than DP.
link: https://t.co/aOAwjFYSKq
#100DaysOfCode#AWS
heapreplace - pops and returns smallest element and pushes the given element
nlargest - returns n largest elements
nsmallest - returns n smallest elements
heapq module is a python standard library which provides implementation of heap queue algorithm.
heapify - transfers lists into heap
heappush - push an element into heap heappop - pop the element from heap
#100DaysOfCode#AWS#connect#SDE
Rest API follows representational state transfer architecture principles, commonly used for web services and supports http( get, post,put, delete) methods with XML, json formats
SOAP API is simple object access protocol only supports xml and have predefined contract
#APIs
When solving DP problems consider solving them bottom up when there is a dependency on next step for the current step
Past few days I have been solving a lot of DP problems, itβs fun and exhausting together.
#100DaysOfCode#AWS
Contd :
Keep popping one by one and poped number will generate another number push that back
1 will generate 12 and check if 12 exists with in range. If yes, push it back to queue.
.
.
2 - 23
3 - 34
As we go one all the sequential digited intergers will be generated.
Leet 1291 : Sequential Digits
Req : to find integers with sequential digits ex : 123,234( difference between digits in an integer is exactly one) within a range
Solved using queue by initializing it with 1,2,3,4,5,6,7,8,9.
#100DaysOfCode#AWS#computersciencestudents
LC 150 : stack problem, if you see an operator just pop last two numbers perform the operation and push the result back into the stack
Yesterday was also a similar problem on stack
Daily problems when solved with consistency can take you places π«‘
#100DaysOfCode
AWS setup and the project work progress has been made.
letβs know more about SQL
DATE_SUB is a function where it is used to subtract a time interval from a date
DATE_SUB(x, INTERVAL y DAY) where we subtract y no of days from x date.
#100DaysOfCode
What do we have on our plate for today?
SQL: Let us know about COALESCE, a SQL function that returns the first non-null expression among its arguments.
In simpler terms, it handles null values and can use any valid expression as the default value in the COALESCE function.
Cross Join : each row from first table is combined with the every row from the other table, this join is rarely used to return all possible combinations where traditional joins selectively combines rows on specified conditions.
#100DaysOfCode#connect#computersciencestudents