Here's an easy and easy to read code for the duplicate string problem: public class Test { public static void main(String[] args) { String interviewString = "There is a tree tree has leaves leaves are green"; Map wordCountMap = new HashMap(); Arrays.asList(interviewString.split(" ")) .stream() .forEach(word -> { if(wordCountMap.get(word) == null) wordCountMap.put(word, 1); else wordCountMap.put(word, wordCountMap.get(word)+1); }); for (String word: wordCountMap.keySet()) { if(wordCountMap.get(word) > 1) { System.out.println(String.format("%s: %d", word, wordCountMap.get(word))); } } } }
Hi , Best channel who are about to give interviews only technical stuff and straight forward interviews.Thank you.. If you have given accenture, infosys, deloitte and comgnizant try to upload them also😊
For the Array shift left problem, create another array with same size, take count of one and put those in new array and now iterate old array and put rest of the elements.
Bhai aise ni krte h. Aap policy ko break kr rhe ho jo ki first policy hoti h harek companiyon ki. Try to not share such Live interviews. Aap Normal videos banao but aisi nhi. Otherwise you may get legal notice from Such companies. Then you will get stuck. It is not a proper professional way to show case such thing Live. I hope it will make sense to you.
There are lot of live interview videos online and I have blurred face and names.... Rest all questions are not unique to this company. Its asked by almost all service based companies so I don't think it will create any issues. If company states anything will mute that part. Thank you
Duplicate String problem code with less no of line String interviewString = "There is a tree tree has leaves leaves are green"; Arrays.stream(interviewString.split("\\s")).stream().collect(Collectors.groupingBy(Function.identity(),Collectors.counting())).entrySet().stream().filter(e->e.getValue()>1).forEach(System.out::println);
Here's an easy and easy to read code for the duplicate string problem:
public class Test {
public static void main(String[] args) {
String interviewString = "There is a tree tree has leaves leaves are green";
Map wordCountMap = new HashMap();
Arrays.asList(interviewString.split(" "))
.stream()
.forEach(word -> {
if(wordCountMap.get(word) == null)
wordCountMap.put(word, 1);
else
wordCountMap.put(word, wordCountMap.get(word)+1);
});
for (String word: wordCountMap.keySet()) {
if(wordCountMap.get(word) > 1) {
System.out.println(String.format("%s: %d", word, wordCountMap.get(word)));
}
}
}
}
Hi , Best channel who are about to give interviews only technical stuff and straight forward interviews.Thank you..
If you have given accenture, infosys, deloitte and comgnizant try to upload them also😊
No dear... I havent given interviews for them as they don't pay that much.
Which company you joined?
Is this actual interview or mock? If real one then how did u recorded it like which desktop app you used
scree.io
@@codeAtoZ thesevare all real interviews right
I have also received offer from coforge. Is it good company to join?
Yes if you get good client... But long term project will have issues
Client is Goldman. All five days work from office
For the Array shift left problem, create another array with same size, take count of one and put those in new array and now iterate old array and put rest of the elements.
Space Complexity increases by O(N).The above problem can be solved using two pointers in O(1) space and O(N) time complexity
@@maheshwarang4000we dont have pointers in java I hope you know that
@@raj006 bhai two pointer is an algorithm not actual pointers from c++
Bhai last me banda tips puchne laga ki 90 days me offer kaise le😂😂. Use bhi switch maarna hoga
Haan.. Mujhe v wahi laga... Interview jaisa lag hi nhi rha tha
Bro for(i= n-1 : 0) and swap krte ans aa jata . O(n) and o(1) mei
Hi bro....what package you got at Genpact finally?
Around 27
@@codeAtoZ how much hike % from previous company?
@@shazjamal8307direct last package hee puch le
@@shazjamal8307 75%
❤
what is the package that they are offering?
26
public class Main {
public static void main(String[] args) {
int[] arr = new int[]{1,2,3,2,4,1,1,2,1,3,1};
int i=0,k=0;
while(k
Interview ka time brain freeze sa ho jaata hai ,how to avoid that
Practice giving as Many interviews as possible
Bhai aise ni krte h. Aap policy ko break kr rhe ho jo ki first policy hoti h harek companiyon ki. Try to not share such Live interviews. Aap Normal videos banao but aisi nhi. Otherwise you may get legal notice from Such companies. Then you will get stuck. It is not a proper professional way to show case such thing Live. I hope it will make sense to you.
There are lot of live interview videos online and I have blurred face and names.... Rest all questions are not unique to this company. Its asked by almost all service based companies so I don't think it will create any issues. If company states anything will mute that part. Thank you
public class ShiftAllOneLeft {
public static void main(String[] args) {
int[] a= {1,2,3,2,4,1,1,2,1,3,1};
int i=0,j=0;//i== 1, j==iterator
while(j
Code for moving 1 in left side with O(logn)
int[] arr = new int[]{1,2,3,2,4,1,1,2,1,3,1};
int i = 0;
int j = arr.length-1;
while(i < j ){
if(arr[i] == 1 && arr[j]==1){
i++;
}
else if ( arr[i] != 1 && arr[j] == 1){
int temp = arr[j];
arr[j] = arr[i];
arr[i] = temp;
j--;
}
else if ( arr[i] != 1 && arr[j] != 1 ){
j--;
}
else {
i++;
j--;
}
}
Cofrege wale interview aise lete hai . Aur client kaa project khatm hone ke baad fire kar dete
Pacakge kitna hy.?
@@mohammedhussain6169 28 lpa
//count of duplicate string
static void countOfDuplicateString() {
String input = "there is a tree tree has leaves leaves are green";
Arrays.asList(input.split(" "))
.stream()
.collect(Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting()))
.entrySet()
.stream()
.filter(s -> s.getValue() > 1)
.forEach(System.out::println);
}
Duplicate String problem code with less no of line
String interviewString = "There is a tree tree has leaves leaves are green";
Arrays.stream(interviewString.split("\\s")).stream().collect(Collectors.groupingBy(Function.identity(),Collectors.counting())).entrySet().stream().filter(e->e.getValue()>1).forEach(System.out::println);
❤