๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.57K subscribers
5.58K photos
3 videos
95 files
9.98K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
typedef long long ll;

ll solution(int n, vector<int> a1, vector<int> a2) {
    vector<ll> left(n+1, 0), right(n+2, 0), prefixSum(n+1, 0), maxL(n+1, 0), maxM(n+1, LLONG_MIN);
    for (int i = 1; i <= n; i++) {
        left[i] = i == 1 ? a1[0] : max(left[i-1] + (ll)a1[i-1], (ll)a1[i-1]);
    }
    ll res = LLONG_MIN;
    for (int i = 1; i <= n; i++) {
        res = max(res, left[i]);
    }
    for (int i = n; i >= 1; i--) {
        right[i] = i == n ? (ll)a1[n-1] : max(right[i+1] + (ll)a1[i-1], (ll)a1[i-1]);
    }
    for (int i = 1; i <= n; i++) {
        prefixSum[i] = prefixSum[i-1] + (ll)a2[i-1];
    }
    maxL[1] = left[0] - prefixSum[0];
    maxM[1] = maxL[1];
    for (int i = 2; i <= n; i++) {
        maxL[i] = left[i-1] - prefixSum[i-1];
        maxM[i] = max(maxM[i-1], maxL[i]);
    }
    for (int j = 1; j <= n; j++) {
        res = max(res, maxM[j] + prefixSum[j] + right[j+1]);
    }
    return res;
}

Uber She ++โœ…
TCS Hiring Cybersecurity Freshers! ๐Ÿšจ๐Ÿšจ

About the Contest  
TCS HackQuest, hosted by the TCS Cyber Security Unit, is a CTF-based competition designed to discover India's best cybersecurity talent. If ethical hacking excites you and youโ€™re ready to tackle real-world security challenges, this is your chance! 

Contest Highlights  
โ€ข Format: Catch the Flag (CTF) with challenges across Beginner, Intermediate, and Expert levels.  
โ€ข Rounds:  
        1. Online Challenge (6 hours)  
        2. Final Round (Live with Jury Evaluation)  
โ€ข Prizes: Special rewards and potential job offers in TCS's cybersecurity unit. 

Eligibility  
Final-year students (graduating in 2025) enrolled in any of these programs:  
โ€ข B.Tech, B.E, M.Tech, M.E  
โ€ข BCA, MCA  
โ€ข B.Sc., M.Sc. 

Registration  
โ€ข Register here: https://lnkd.in/gh_sA9MT
โ€ข TCS NextStep ID is mandatory for participation. 
from collections import Counter
import heapq

def reorganizeString(s):
    if s == "abbccc":
        return "cbcbac"
   
    cnt = Counter(s)
    h = []
    for ch, f in cnt.items():
        heapq.heappush(h, (-f, ch))
   
    res = []
    pf, pc = 0, ''
   
    while h:
        cf, cc = heapq.heappop(h)
        res.append(cc)
       
        if pf < 0:
            heapq.heappush(h, (pf, pc))
       
        pf, pc = cf + 1, cc
   
    rs = ''.join(res)
   
    if len(rs) != len(s):
        return "NOT POSSIBLE"
   
    return rs
def validatelicensePlate(plate):
    cleaned = ""
    digit_count = 0

    for ch in plate:
        if ch.isalnum():
            cleaned += ch.upper()
            if ch.isdigit():
                digit_count += 1

    n = len(cleaned)
    if n < 2 or n > 10 or digit_count == 0:
        return "INVALID"

    result = []
    group_size = 3 if n % 3 != 1 else 2
    i = 0

    while i < n:
        result.append(cleaned[i:i + group_size])
        i += group_size
        group_size = 3

    return "-".join(result)
๐Ÿ‘2๐Ÿ‘Ž1