English
Open in Telegram

Post#include<bits/stdc++.h>

12 June 2023
H
Happy
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; unordered_map<int,int> mp; vector<int> nums(n); for(int i=0; i<n; i++){ cin>>nums[i]; if(nums[i]!=-1) mp[nums[i]]+=i; } int maxi = INT_MIN; int res = 0; for(auto i: mp){ if(maxi<i.second){ maxi=i.second; res = i.first; } } cout<<res; }
1.1K ·

Nearby in the feed

HHappyimport collections v=int(input()) l=list(map(int,input().split())) d=collections.defaultdict(int) for k,v in enumerate(l): if v!=-1: d[v]+=k req=max(d.values())HHappyMaximum weight Node, #python #Juspay
this message
HHappyMaximum weight Node #c++ #juspayMMachine Learning coderlargest cycle sum Language python 3
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