๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.61K photos
3 videos
95 files
10.6K 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
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
def calculate_score(text, prefix, suffix):
    max_score = 0
    max_pre = 0
    result = ""

    for i in range(len(text)):
        for j in range(i + 1, len(text) + 1):
            sub_str = text[i:j]
            pre = find_pre_length(sub_str, prefix)
            post = find_post_length(sub_str, suffix)

            if max_score < (pre + post):
                max_score = pre + post
                result = sub_str
                max_pre = pre
            elif max_score == pre + post:
                if pre > max_pre:
                    max_pre = pre
                    result = sub_str
                else:
                    arr = [result, sub_str]
                    arr.sort()
                    if arr[0] == sub_str:
                        result = sub_str
                        max_pre = pre

    return result

def find_post_length(sub_str, suffix):
    max_len = 0
    for i in range(len(sub_str)):
        length = 0
        str_part = sub_str[i:]
        k = 0
        for j in range(len(suffix)):
            if k < len(str_part) and str_part[k] == suffix[j]:
                length += 1
                k += 1
            else:
                break
        if length > max_len and k == len(str_part):
            max_len = length
    return max_len

def find_pre_length(sub_str, prefix):
    max_len = 0
    for i in range(1, len(sub_str) + 1):
        length = 0
        j = len(prefix) - 1
        str_part = sub_str[:i]
        k = len(str_part) - 1

        while j >= 0 and k >= 0:
            if str_part[k] == prefix[j]:
                length += 1
                k -= 1
                j -= 1
            else:
                break
        if length > max_len and k == -1:
            max_len = length
    return max_len

if __name__ == "__main__":
    text = "nothing"
    prefix = "bruno"
    suffix = "ingenious"
    result = calculate_score(text, prefix, suffix)
    print(result)


Approximate Matching โœ…
Apple
๐Ÿ“ŒAnlage Infotech (India) Pvt Ltd is Hiring for "Data Analyst"

Role: Data Analyst

Location - Noida
Experience: 0 - 1 Year
โœจFreshers Eligible
Immediate joiner

Interested candidates can share their CV at
Kavita.c@anlage.co.in
Amplelogic is hiring Interns, come on freshers don't miss this wonderful opportunity, share your CVS to thejaswini.c@amplelogic.com

Position : Devops interns (B tech fresher who got trained in devops only can apply)

Location : Hyderabad(onsite)

Note : based on the performance the internship will be converted to full time employment.
๐Ÿ‘2