Count K-Subsequences of a String with Maximum Beauty Solution || Leetcode Bi-Weekly 112 Get link Facebook X Pinterest Email Other Apps - September 04, 2023 Count K-Subsequences of a String with Maximum Beauty Get link Facebook X Pinterest Email Other Apps
Laptop Recommendation Solution || Codechef Starters - 37 Get link Facebook X Pinterest Email Other Apps - May 04, 2022 Laptop Recommendation Solution Codechef Starters - 37Problem Code : LAPTOPRECProblem Link : https://www.codechef.com/START37C/problems/LAPTOPRECSolution :#include <bits/stdc++.h>#define ll long long intusing namespace std;int main(){ ll t = 1; cin >> t; while (t--) { ll n; cin >> n; ll a[10] = {0}; ll temp; ll m = INT_MIN; for (ll i = 0; i < n; i++) { cin >> temp; a[temp - 1]++; m = max(m, a[temp - 1]); } ll count = 0; for (ll i = 0; i < 10; i++) { if (a[i] == m) count++; } if (count > 1) { cout << "CONFUSED\n"; } else { for (ll i = 0; i < 10; i++) { if (a[i] == m) { cout << i + 1 << "\n"; return; } } } }} Get link Facebook X Pinterest Email Other Apps Comments
Exact Marks Solution || Codechef March Long Challenge 2022 - I - March 11, 2022 Exact Marks Solution Read more
Substring of a Substring Solution || Codechef March Long Challenge 2022 - I - March 11, 2022 Substring of a Substring Solution Read more
Binary Base Basics Solution || Codechef February Long Challenge 2022 - I - February 04, 2022 Binary Base Basics Solution Read more
Comments
Post a Comment