๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.59K subscribers
5.59K photos
3 videos
95 files
10.1K 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
int solution(int[] visits, int target) {
    int runningSum = 0;
    for (int i = 0; i < visits.length; i++) {
        runningSum += visits[i];
        if (runningSum >= target) {
            return i;
        }
    }
    return -1;
}

Visa โœ…
def process_string(number):
    while True:
        found_consecutive = False
        new_string = []
        i = 0
        while i < len(number):
            j = i
            while j < len(number) and number[j] == number[i]:
                j += 1
            if j - i > 1:
                found_consecutive = True
                sum_of_digits = sum(int(number[k]) for k in range(i, j))
                new_string.append(str(sum_of_digits))
            else:
                new_string.append(number[i])
            i = j
        number = ''.join(new_string)
        if not found_consecutive:
            break
    return number


Visa โœ…
def letterCaseDifference(typedText: str) -> int:
    upper_count = 0
    lower_count = 0
    for char in typedText:
        if char.isupper():
            upper_count += 1
        elif char.islower():
            lower_count += 1
    return upper_count - lower_count

Visa โœ…
from collections import Counter
def countValidWords(s):
    def is_valid(word):
        if len(word) < 3:
            return False
        if not all(char.isalnum() for char in word):
            return False
        has_vowel = any(char.lower() in 'aeiou' for char in word)
        has_consonant = any(char.isalpha() and char.lower() not in 'aeiou' for char in word)
        return has_vowel and has_consonant
    words = s.split()
    count = sum(1 for word in words if is_valid(word))
    return count


Word Count Tool โœ…
def roman_to_decimal(a):
    b = {'I': 1, 'V': 5, 'X': 10, 'L': 50} 
    c = 0 

    for i in range(len(a)):
        if i > 0 and b[a[i]] > b[a[i - 1]]:
            c += b[a[i]] - 2 * b[a[i - 1]]
        else:
            c += b[a[i]]

    return c

def sortRoman(names):
    def custom_sort(e):
        d = e.split() 
        return (d[0], roman_to_decimal(d[1]))

    sorted_names = sorted(names, key=custom_sort)
    return sorted_names
Romanizer โœ…
๐Ÿ‘1
def a(b, c, d, e, f, g):
    if c == e:
        g.append(tuple(sorted(f)))
        return
    if c > e or b >= len(d):
        return
    a(b + 1, c + d[b], d, e, f + [d[b]], g)
    a(b + 1, c, d, e, f, g)
def h(i, j, k):
    l = []
    a(0, 0, k, j, [], l)
    m = set(l)
    return len(m)
n, k = map(int, input().split()) 
pieces = list(map(int, input().split()))
print(h(n, k, pieces))


The Puzzle Masters of puzzleville โœ…
DeltaX
๐Ÿ‘1๐Ÿคฎ1