top of page

LeetCode Problem and Answer

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

Updated: Jan 24, 2025

Climbing Stair


} return a;
} return a;

Valid Paranthesis






remove element

==



rotate array

==



Integer to Roman

===


two sum

===


find min no in sorted and rotated array

===


find missing no

==


min no of platform

===


find leader in array

==


How to remove duplicate element from sorted array



How to rotate an array by k times

===


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

k= + ve, then left rotate



move zero to end of array

===




how to find a leader in array

===

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



freq of element in a sorted array

===


max sum of subarray of size 3

===

sum 42

sum 36


sum 48


sum 24


Find max subaaray sum

===




KEdan Algorithm

==

8 > maxsum , no , no changes to maxsum

if >, maxsum=sum;

this is max subarray sum.



find meadian of 2 sorted array

==



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

==


 
 
 

Recent Posts

See All
Best Chunking Practices

1. Chunk by Semantic Boundaries (NOT fixed size only) Split by sections, headings, paragraphs , or logical units. Avoid cutting a sentence or concept in half. Works best with docs, tech specs, policie

 
 
 
Future State Architecture

USE CASE: LARGE RETAIL BANK – DIGITAL CHANNEL MODERNIZATION 🔹 Business Context A large retail bank wants to “modernize” its digital channels (internet banking + mobile apps). Constraints: Heavy regul

 
 
 

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