Giter Site home page Giter Site logo

Comments (2)

kishanrajput23 avatar kishanrajput23 commented on May 27, 2024

okk bro

from nptel-the-joy-of-computing-using-python.

joeydash avatar joeydash commented on May 27, 2024

I have done it

al = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
al = al.split(" ")


def get_index(ch):
    for i in range(len(al)):
        if ch == al[i]:
            return i


def get_cj(ch):
    return al[(get_index(ch) + 5) % 26]


def get_cifar(st):
    st = [get_cj(i) for i in st]
    return ''.join(st)


def get_counted_letter(wo):
    data = {}
    for ch in wo:
        if ch in data.keys():
            data[ch] += 1
        else:
            data[ch] = 1
    return data


def check_cifar(wr, ci):
    cdata = get_counted_letter(get_cifar(wr))
    gcdata = get_counted_letter(ci)
    cdata_keys = cdata.keys()
    gcdata_keys = gcdata.keys()
    for i in cdata_keys:
        if i not in gcdata_keys:
            return False
        if cdata[i] != gcdata[i]:
            return False
    return True


wr = input()
ci = input()
if (check_cifar(wr, ci)):
    print("Yes", end="")
else:
    print("No", end="")

from nptel-the-joy-of-computing-using-python.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.