Giter Site home page Giter Site logo

iem_coding-5th-semester's Introduction

IEM_CSE Coding 5th Semester

Solutions for the coding assignments, IEM CSE Dept., 5th Semester.

DAY 1 : Vessel filling problem

Given two vessels, one of which can accommodate 'a' liters of water and the other which can accommodate 'b' liters of water, determine the number of steps required to obtain exactly 'c' liters of water in one of the vessels.

At the beginning both the vessels are empty. The following operations are counted as 'steps':

  1. Emptying a vessel
  2. Filling a vessel completely
  3. Pouring water from one vessel to the other, without spilling, until one of the vessels is either full or empty.

DAY 2 : Bit Pairs

Given N three-digit numbers, your task is to find the bit score of all N numbers and then print the number of pairs possible based on these calculated bit scores.

  1. Rule for calculating bit score from three digit number: From the 3-digit number, extract largest digit and multiply by 11 then extract smallest digit multiply by 7 then add both the result for getting bit pairs. Note: - Bit score should be of 2-digits, if above results in a 3-digit bit score, simply ignore most significant digit.

  2. Rules for making pairs from above calculated bit scores Condition for making pairs are Both bit scores should be in either odd position or even position to be eligible to form a pair. Pairs can be only made if most significant digits are the same and at most two pairs can be made for a given significant digit.


DAY 3 : Strings and length counts

Q.1. Given a string of words separated by spaces. The task is to find the first maximum length, even word, from the string. Eg: “You are given an array of n numbers” The answer would be “an” and not “of” because “an” comes before “of”.

(a) Now modify your code to display n th even length word (where n is given as user input).

(b) Modify your code to find the m th maximum length word.


iem_coding-5th-semester's People

Contributors

balaka-18 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.