Coder Social home page Coder Social logo

hclhackiitk's Introduction

HclHackIITK

A cybersecurity hackathon.

There were two types of programming questions, one was related to advanced coding and the other one was related to ML Classification.

Question 1 (coding: Palindromes)

You are required to write a Python function to read a file from the given. The file contains text lines and your function has to read each line and detect if the line is a palindrome along with count the number of characters.

If the line is a palindrome, then record the line number of this line in the file. The line number starts from 1. Not all lines are necessarily palindromes. Finally, count all the number of palindromes. Your program needs to return a dictionary with the line number of a palindrome and number of characters in the palindrome (excluding blank spaces) along with a string representing the status of reading the file. If the file has no palindrome, the dictionary returned should contain {0:0} If the URL is correct and the file is a txt file, the status message should be "file ok". If the URL is correct but the file is not a txt file, the status message should be "file is not a text file". If the URL is not a valid URL, the status message should be "the URL is incorrect". Input Specification: The string value representing the URL of the file. Output Specification: Return an object of the "Result" class. The object should have: a dictionary with the key as the line number and value as the count of the number of characters a string representing the status message

Example Input:

https://mettl-arq.s3-ap-southeast-1.amazonaws.com/questions/iit-kanpur/cyber-security-hackathon/round1/problem1/defaulttestcase.txt

Output:

output1: {2:4, 5:7, 6:30, 8:30, 9:9, 12:5, 14:11}

output2: "file ok"

Solution: The Solution is given in the location /coding/q1.py

Question 2 (ML: )

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.