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
Maximum OR Minimum Solution || Codechef Starters - 37 Get link Facebook X Pinterest Email Other Apps - May 04, 2022 Maximum OR Minimum Solution Codechef Starters - 37Problem Code : MAXORMINProblem Link : https://www.codechef.com/START37C/problems/MAXORMINSolution :#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[n]; ll one = 0, zero = 0; for (ll i = 0; i < n; i++) { cin >> a[i]; if (a[i]) { one++; } else { zero++; } } if (one >= zero) { cout << "1\n"; } else { cout << "0\n"; } }} Get link Facebook X Pinterest Email Other Apps Comments
Substring of a Substring Solution || Codechef March Long Challenge 2022 - I - March 11, 2022 Substring of a Substring Solution Read more
Exact Marks Solution || Codechef March Long Challenge 2022 - I - March 11, 2022 Exact Marks Solution Read more
Comments
Post a Comment