Thank you! Mahesh, I'm glad to hear you're finding the content valuable. If you have any specific topics or concepts you'd like to explore, feel free to let me know!
Hi Aditya, Thanks for the video. I need your help on below coding question Input: {1,1,0,1,1,1,0,2,2,1,1,2,2,1,1,0,0,0,1} Output: Number Run. Count 1 2 3 0 1 2 1 3 1 2 2 2 If we take example as 1 number from the output. Run is nothing but 1 repeated two times in the input and the count corresponds to how many such combinations were present in the input. This question was asked in Trans Union Company. Please let me know if you are not clear on the question. Hint they have given Map of Map. Also they asked which collection would you prefer to store above data? I need sample code on Java 8 or prior Java version is also fine.
Hi Naveen. I just saw your comment. Could you explain the output portion a bit ? Is that output is final output of the problem or else it was just example to explain logic?
Hi Naveen, import java.util.*; public class RunCount { public static void main(String[] args) { int[] input = { 1, 1, 0, 1, 1, 1, 0, 2, 2, 1, 1, 2, 2, 1, 1, 0, 0, 0, 1 }; // Create a Map to store runs and counts for each number Map<String, Map<String, Integer>> result = new LinkedHashMap<>(); // Iterate through the input array String key = ""; for (int i = 0; i < input.length - 1; i++) { key = key + input[i] + ","; if (input[i] != input[i + 1]) { var innerMap = result.getOrDefault(key, new HashMap<>()); if (innerMap.size() > 0) { int count = innerMap.getOrDefault("Count", 0); innerMap.put("Count", ++count); } else { innerMap.put("Run", key.length() / 2); innerMap.put("Count", 1); } result.put(key, innerMap); key = ""; } } // Print the header System.out.println(result); System.out.println("Number\tRun\tCount"); for (var combination : result.entrySet()) { String number = combination.getKey().substring(0, 1); Integer run = 0; Integer count = 0; Map<String, Integer> innerMap = result.get(combination.getKey()); for (var attribute : innerMap.entrySet()) { if (attribute.getKey().equals("Run")) { run = innerMap.get(attribute.getKey()); } else { count = innerMap.get(attribute.getKey()); } } System.out.println("\t" + number + "\t" + run + "\t" + count); } I was able to get the out put as provided in your problem Number Run Count 1 2 3 0 1 2 1 3 1 2 2 2 0 3 1 I was held in other editing work. Let me know this work or we can improve this further. I hope this works as a brute force approach.
Hello! The Asus TUF F15 i7 12700 model I purchased last week has a normal temperature of 40 degrees, but when I enter RU-vid, it goes up to 70 degrees. Is this normal? Have you experienced a similar situation?
Hi @Drongo_1 Nope, when using youtube and watching movies thermals are in 30 - 40 range only. If you are experiencing means you have plugged in and turbo mode is on. Turn off turbo to silent for less heavy tasks like watching movies. Use turbo mode for heavy tasks like gaming and editing. Hope this helps you..
@@codewithpassion67I've been using it in silent mode, but the temperature is reaching these values. I've tried many methods to reduce it, but I think this is not a problem I can solve. Thanks for your reference. I'll probably show this to a computer technician.
Hi bro, I bought during the flipkart republic day sales time. I got it for 93k using card offers. Better wait for some sale time and buy. i7 12 th gen, 4060 RTX, 16 GB RAM and 512 GB SSB
Hi bro For what purpose your are planning to buy ? It was decent one. I have played games like GTA, Spiderman, horizon. No issues as of now. Only one issue is the fan sound in turbo mode. I can see thermals also increased but, performance wise it good to go, if your under 90k - 1 lakh budget go for it.