top of page

LeetCode Problem and Answer

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • Jan 20
  • 1 min read

Updated: Jan 24

Climbing Stair


ree
ree
ree
} return a;
} return a;

Valid Paranthesis


ree

ree

ree
ree
ree

ree
ree
ree

remove element

==

ree

ree
ree
ree

rotate array

==

ree
ree

ree
ree
ree
ree
ree

Integer to Roman

===

ree
ree

two sum

===

ree

find min no in sorted and rotated array

===

ree

find missing no

ree

==


min no of platform

===

ree

find leader in array

==


How to remove duplicate element from sorted array

ree

ree
ree
ree

How to rotate an array by k times

===

ree

ree

if k=-1, then right rotate and k=k+lengh of array

k= + ve, then left rotate


ree
ree
ree

move zero to end of array

===

ree

ree

ree

how to find a leader in array

===

Leader is a element > all elelemtns to its right side. right most element is always a leader.


ree

freq of element in a sorted array

===

ree
ree

max sum of subarray of size 3

===

sum 42

ree

sum 36

ree

sum 48

ree

sum 24

ree
ree

Find max subaaray sum

===

ree
ree

ree

ree
ree

ree

KEdan Algorithm

==

8 > maxsum , no , no changes to maxsum

if >, maxsum=sum;

ree
ree
ree
ree

this is max subarray sum.


ree

find meadian of 2 sorted array

==

ree

ree

public static float medianof2sortedarrray(int[]a,int[]b){

int i=j=k=0;

int m[]=new int[a.length +b.length]

while(i<a.length && j < b.length){

if(a[i] <b[j]){

m[k]=a[i];

i++;

K++;

}else{


m[k]=b[j];

k++;

j++;

}

}//while end

while(i<a.length){

m[k]=a[i];

i++;k++;

}

while(j<b.length){

m[k]=b[j];

j++;

k++;

}

int mid=0;

if(m.length%2==0){

mid=m.length/2;

return (flaot)(m[mid]+m[mid-1]/2);

}else{

mid=m.length/2;

return m[mid];

}


time com=big o(m+n)


find given array is sorted or not

==

ree

 
 
 

Recent Posts

See All
why springbatch job??

Spring Batch Job Spring Batch is designed exactly for batch workloads  like Pro*C migrations. ✅ Advantages: Chunk-oriented processing...

 
 
 
Pro*c Job to Spring Batch Job

Example1: 📌 Background Pro*C job  → Written in C with embedded SQL, often used for batch ETL-like jobs in Oracle. Spring Batch job  →...

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page