Java Program to find longest substring without repetition| Amazon coding interview questions

preview_player
Показать описание

Java Program to find longest substring without repetition| Amazon coding interview questions

(For all updates on Java interview questions and java tutorials join the telegram group)
Search in Telegram with text Java Tutorials if you are unable to join telegram with above link

1) How to read a matrix from console in java?

2) How to remove duplicates from string in java?

3) Write a java program to duplicate characters with number of occurences in java?

4) Write a java program to implement bubble sort part 1?

5) Write a java program to check string is palindrome or not?

6) Write a java program to print floyds triangle?

7) Write a java program to print floyds triangle?





8) How to count number of vowels in a string in java?

9) How to find largest and smallest values in an array in java?

10) Write java program to find duplicate elements in array in java?

11) write a java program to check the input number is prime or not in java?

12) Write a java program to print pyramid pattern of numbers?

13) Write a java program to find missing number in array in java?

14)Write a java program to print numbers in java up to 10 with out using loops?

15) How to sort elements in array in asc and desc order in java?



16) Write a java program to find factorial of a number in java?

17) write a java program to find second largest element in the array in the java?

18) Write a java program to check two Strings are anagrams or not by sorting and comparing strings?

19) Write java program to print Characters count in each word in String ?

20) Write a java program to find reverse of a string in java?

21) Write a java program to add elements in an array in java?

22) Write a java program to find largest of three numbers?



23) Write a java program to print multiplication table?

24) Write a java program to print star pattern?

25) Write a java program to find factors of number from 1 to 100

26) Write a java program to print fibonacci series using loops?

27) Write a java program to print Ascii values of a Character ?

off campus placement,
placement,
amazon,
google,
microsoft,
love babbar,
amazon hyderabad,
off campus,on campus,coding,competetive programming,leetcode,hackerrank,codeforces,topcoder,spoj,geeksforgeeks,software engineer,
Learn with Krishna Sandeep,
durga sir,
durga,
java,
java brains,
Рекомендации по теме
Комментарии
Автор

Thank you so much for this videos! You help me get ready for my interview!

Robcuisimplu
Автор

Thank you..Keep it up..More power to you👍

lawanutech
Автор

Thanks for sharing your idea.
But in interview I had seen that we had one rule
"Don't use any inbuilt methods".
Here we use predefined data structure set and its method.

shankardayal
Автор

Really i am stucked in solving geeks for geeks. After I solve your 100 basics problem. I have feelings to crack any questions.

channelcuriousity
Автор

This will won't give correct o/p in case of str = "dvdf"; -> longest would be 'vdf'

prakashranjan
Автор

try this one guys without any additional loops..
HashSet<Character> cha=new HashSet<>();
String Longest="";
String current="";
int j=0;
for(int i=0;i<s.length();)
{
char c=s.charAt(i);
if(cha.contains(c))
{
current="";
cha.clear();
i=++j;
}
else {
cha.add(c);
current+=c;
++i;
}

{
Longest=current;
}

}

narendramodi
Автор

As per the problem statement, for the string "abcdablsdh", isn't it expected to return "cdabls" as the result? However, it returns "ablsdh" because during the first iteration of the for-loop, once we reach the second "a" (index 4), we break there and continue with the result of the string. Is this what we are trying to achieve here? Your explanation would be helpful.

premkumareaswaran
Автор

Sir to find longest substring - all substrings r of same length, none of them is large- abcd, bcda, cdab

_sah
Автор

sir,
for taking user input what i need to do?

bharathkumard
Автор

This code does not seems to work for "dvdf" the output comes as dv it should come as vdf

harshitsaluja
Автор

I haven't tested your code but I think it won't find the correct longest substring in every inputs. e.g. abcdaeb -> bcdae

shenth
Автор

Sir couldn't reach the telegram group assume the link might be expired

freeebeee
Автор

It won't work for all String. For example, it won't work for ABADEXED

dakshinrajavel
Автор

Sir u r explaintion is very super I know theory of all java concept but coading section I can fail pls how start coding improvement

maheshnaga
Автор

Ok i understood this completely..
So can you please tell me whether the actual competitive programming is just like this or way harder than this?
Asking Just for some motivation.

amans
Автор

Thank you 😊. But why didn't you execute the program?

mtcqzim
Автор

Sir you have to kept link of source code

saikrishnasaikrishna
Автор

Microsoft Interview Program : Input KKCCDFC out put should be KK2CC2D1F1C1, request you create video for this program

rohanchristopher
Автор

Longest substring with How to change the existing code sir

srinivasand
Автор

Hi you are doing a great work really thank you for all these effors from your side.

Wanted to ask I was trying with different combination of Strings for eg:-

"abacdab" -> the output for this should be cdab but if gives acd. The idea of removing the set and emptying the string inside the loop needs to be modified a bit.

uttamdey