English
Open in Telegram

Postpackage Learn.com;

10 February 2025
D
Deloitte | COGNIZANT | IBM | CAPGEMINI
package Learn.com; import java.util.Scanner; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int L = sc.nextInt(); int U = sc.nextInt(); sc.close(); if (L < 0 || U < L || U > 100) { System.out.println("Invalid input! Please ensure 0 <= L <= U <= 100"); return; } Map<Integer, Integer> freqMap = new HashMap<>(); for (int i = L; i <= U; i++) { for (int j = i + 1; j <= U; j++) { int diff = Math.abs(i - j); freqMap.put(diff, freqMap.getOrDefault(diff, 0) + 1); } } int maxFrequency = 0; int mostFrequentDiff = 0; for (Map.Entry<Integer, Integer> entry : freqMap.entrySet()) { if (entry.getValue() > maxFrequency) { maxFrequency = entry.getValue(); mostFrequentDiff = entry.getKey(); } } System.out.println("Marathon Winner: " + mostFrequentDiff + " minutes (occurring " + maxFrequency + " times)"); } } #Marthon_Winner_Finder
758 ·

Nearby in the feed

DDeloitte | COGNIZANT | IBM | CAPGEMINIComouter rental ✔️ #Offline_IBM_codingDDeloitte | COGNIZANT | IBM | CAPGEMINIIBM OFFLINE CODING ✅✅ PYTHON 7/7 CASES PASSED ✅ JAVA 5/7 CASES PASSED WITH THE DRIVER CODE NOT CONFIGURED PROPERLY ✅
this message
DDeloitte | COGNIZANT | IBM | CAPGEMINIpublic class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int p = sc.nextInt(); if (p <= 0 p > 100) { System.out.printlnDDeloitte | COGNIZANT | IBM | CAPGEMINIWipro ON-CAMPUS EXAM cleared ✅ Contact: @MLCODER2
DDeloitte | COGNIZANT | IBM | CAPGEMINIDeloitte | COGNIZANT | IBM | CAPGEMINI@python_java_Coding · channel · Tech
7 178subscribers406average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count